Token management improvement #3610
No reviewers
Labels
No labels
BE Request
Backlog
Better behavior
Blocked by deps
Bug
Code Review
Discussion
Doing
Feature Request / Enhancement
In the shining bright future maybe
It's complicated
MS Edge
Mememoon (or other niche browsers)
Missing API
Missing feature
Missing l10n/i18n
NL1
NL2
NL4
Need to verify on develop
RELEASE BLOCKER
Reassign or Close
Refactor
Regression
Safari
To Do
User story
Waiting on godot
accessibility
better documentation
chore
confirmed
easy ticket
incident
l10n update
mastoapi
mobile
needs design
needs-info
needs-review
stupid
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
pleroma/pleroma-fe!3610
Loading…
Reference in a new issue
No description provided.
Delete branch "token-management-improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
/oc review
Greptile-style review — Token management improvement
opencode-agent:job=178:generation=1
Reviewed the full
develop(3c09397a) →token-management-improvements(9d2ea24c) diff plus surrounding code. The bulk-revoke queue, current-token/last-active display, and i18n plural strings all look sound, but there are two high-impact defects below that should block merge, plus three medium-impact ones.P1 — Branch predates
developand would revert #3604 on squash/rebase mergedevelopat3c09397ais the merge of #3604 ("Do not send read requests for notifications already read"). The head commit9d2ea24cdoes not descend from it (merge-base is527ef0e4).develop..headdiff therefore deletes exactly what #3604 added: theseenguards insrc/stores/notifications.js, the wholetest/unit/specs/stores/notifications_read_requests.spec.jsregression test (52 lines), andchangelog.d/notifications-read-spam.fix.token-management-improvementsonto currentdevelopbefore merging.P1 —
StatusCodeError.statusTextchange silently disables the unsupported-notification-type fallbacksrc/services/errors/errors.js:statusTextchanged from the response body (body.error || body.errors || body) toresponse.statusText(the HTTP reason phrase, e.g."Bad Request").src/stores/fetchers/notifications_fetcher.js:43(unchanged by this PR) doeserror.statusText.includes('Invalid value for enum')and thenmatchAlls type names out of it to drop unsupported notification types and retry.types[]value, notification polling permanently fails and pushes a global error notice on every 10s poll instead of degrading gracefully.error.errorData), or restore the oldstatusTextsemantics and expose the HTTP phrase under a new name.P2 —
validUntildates ignore the app locale (Ref passed instead of string)src/components/settings_modal/tabs/security_tab/tokens.js:27,40:const { locale } = useI18n()gives aRef, butlocaleService.internalToBrowserLocale(locale)expects a string (every other call site passesthis.$i18n.locale). The lookup misses, the Ref flows intotoLocaleDateString(), which falls back to the runtime default locale — and the computed never tracks locale changes since.valueis never read.locale.value.P2 — Selection bookkeeping allows confirming an empty revoke queue
tokens.js:allSelectedisselected.value.size >= tokens.value.length— it ignoresusTokens, and is vacuouslytruewhen the list is empty (0 >= 0), which enables the "Revoke selected" button with nothing selected.revokeTokens()with an empty queue:revokeQueue.value.shift()yieldsundefined, so it callsrevokeToken(undefined)→DELETE /api/oauth_tokens/undefined→ 404 error alert for a no-op action.selected.value.size > 0forallSelected, compare against the visibleallTokenslength, and return early when the queue is empty.P2 — Revoking the current session token leaves the client half-logged-in
currenttoken — styled-dangerbut with no extra handling. After a successful self-revoke the store drops the token from the list whileuseOAuthStore().userTokenstays set, so subsequent API calls fail with auth errors instead of a clean logout/redirect.Merge readiness: 3/5
Capped by the two P1s. Rebase onto
developand restore a body-derived error channel for the fetcher check, and this is in good shape — the queue/retry flow, plural strings, andConfirmModalwiring all check out./oc review
Greptile-style review — Token management improvement
opencode-agent:job=179:generation=1
Reviewed the full
develop(3c09397a) →token-management-improvements(6263736e) diff plus surrounding code and the live discussion. No new findings.Prior review follow-up
The earlier
REQUEST_CHANGESreview (against9d2ea24c) raised five defects. I verified each against the current head — all are addressed:develop(merge-base is3c09397a), so theseenguards, thenotifications_read_requests.spec.jsregression test, and the changelog fragment are intact.src/stores/fetchers/notifications_fetcher.jsandsrc/stores/admin_settings.jsnow match against the body-derivederrorDatafield instead of the HTTP reason phrase.validUntillocale Ref — fixed.tokens.jsnow passeslocale.valuetointernalToBrowserLocale.allSelectedrequiresselected.size > 0andrevokeTokensreturns early on an empty queue.currenttoken, and bulk select only covers non-current tokens.Current head
The bulk-revoke queue with retry/backoff, current-token/last-active display,
usTokens/tokenssplit, i18n plural strings, andConfirmModalwiring all check out. Remaining observations (leftoverfalseliterals inlogin_form.js:45andoauth.jssetClientData, deadmethods.revokeToken, cosmetic MFA heading changes) are behavior-neutral and below the reporting bar.Findings
None. No P0/P1/P2 defects found in the current diff.
Merge readiness: 5/5
Production-ready with no known findings. Approve.