Stop signOut() blocking on access token revocation - #72
Conversation
requestAccessTokenRevocation() was awaited directly in signOut()'s critical path before the redirect, with a 10s timeout as its upper bound. A slow or unreachable revocation_endpoint (or CORS-unfriendly OP) stalled the entire sign-out flow, showing a blank page between the auth UI tearing down and the actual redirect firing. Fires the revocation request without awaiting it instead, so it can't delay sign out. Since it's no longer awaited, the access token is now snapshotted before firing the request so a concurrent clearSession can't race it out of storage first.
|
Warning Review limit reached
Next review available in: 2 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Purpose
Follow-up to #70.
signOut()awaitedrequestAccessTokenRevocation()directly in the critical path before the redirect, with a 10s timeout as its upper bound. A slow or unreachablerevocation_endpoint(or a CORS-unfriendly OP, which is common for revocation endpoints specifically) stalled the entire sign-out flow, since the app's authenticated UI typically tears down as soon assignOut()is called but the actual redirect doesn't fire until the revocation request settles or times out. That produced a blank/white page for up to 10 seconds on every sign out where revocation was enabled and slow.Approach
Fires the revocation request without awaiting it, so its latency can't delay the redirect. Revocation stays best-effort exactly as before — failures are still caught and logged, just asynchronously now.
Since the request is no longer awaited,
requestAccessTokenRevocation()now accepts an optionalaccessTokenoverride.signOut()snapshots the access token from storage before firing the request off, instead of letting the request read it lazily from storage — otherwise the concurrentclearSession/clearSessionAsynccall right after could remove the token from storage before the fire-and-forget request reads it, sendingtoken=undefinedto the OP.Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks