Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix session handling across multiple pages #2077

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

infomiho
Copy link
Contributor

@infomiho infomiho commented Jun 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant