You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2025. It is now read-only.
Currently, the authentication event handler in src/App.tsx always calls queryClient.invalidateQueries() for all Clerk events. This can leave stale data from a previous user briefly visible after sign-out.
Proposed Enhancement
Update the implementation to:
Pass the full Clerk event to the callback (modify useOnClerkEvent hook)
Branch on event type in the callback:
Use queryClient.clear() for sign-out/session invalidation events
Use queryClient.invalidateQueries() for other auth events
This will ensure the cache is completely cleared on sign-out while maintaining normal invalidation for other authentication state changes.
Context
This enhancement was identified during the review of PR #184 which implements basic query cache invalidation on auth changes.