wasp icon indicating copy to clipboard operation
wasp copied to clipboard

Fix session handling across multiple pages

Open infomiho opened this issue 1 month ago • 0 comments

Related to #2075

Implements checks to maintain session ID across multiple pages, preventing unexpected logouts as reported in the issue.

  • Session ID Management: Modifies setSessionId to emit sessionId.set only if the new sessionId differs from the current one, ensuring unnecessary updates are avoided.
  • Clear Session ID Safeguard: Updates clearSessionId and the response interceptor for 401 errors to check if a new sessionId exists in storage before clearing the current one. This prevents the removal of valid session IDs due to stale requests.
  • Event Listener Unchanged: Maintains the existing event listener for the storage event, ensuring sessionId changes are synchronized across tabs without removing valid session IDs on stale requests.

For more details, open the Copilot Workspace session.

infomiho avatar Jun 03 '24 18:06 infomiho