Refresh in-memory Client after sign-out and add tests#587
Refresh in-memory Client after sign-out and add tests#587
Conversation
Perform a best-effort Client.getSkippingClientId() refresh after local sign-out cleanup so stale in-progress sign-in/sign-up state does not persist across remounts.\n\nAlso expands SignOutService tests to mock ClientApi and assert the refresh call occurs and failures are tolerated.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis change adds a best-effort client state refresh to the sign-out flow. After the existing local sign-out cleanup (token deletion and session/user state clearing), the code now attempts to call Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Motivation
Clientwhile skipping the current client id.Description
SignOutService.signOut()by invokingClient.getSkippingClientId()inside thefinallyblock and logging failures.Clientand perform the refresh viarunCatching { Client.getSkippingClientId() }to avoid breaking sign-out flow on refresh errors.ClerkApi.clientandClientApi.getSkippingClientId()and update existing sign-out tests to include the client refresh expectation.signOut refreshes client after local sign-out cleanupandsignOut tolerates client refresh failurewhich verify the client refresh is called and that refresh failures are tolerated.Testing
SignOutServiceTestsuite including the two new testssignOut refreshes client after local sign-out cleanupandsignOut tolerates client refresh failure, and all tests passed.ClientApi.getSkippingClientId()and passed successfully.SignOutService.signOut()returnsClerkResult.Successon normal flows and still clears local state when server sign-out or client refresh fails.Codex Task