Skip to content

fix(remote): verify the account before keeping remote requests - #1182

Closed
EhabY wants to merge 2 commits into
fix/workspace-session-isolationfrom
fix/remote-session-account-check
Closed

EhabY wants to merge 2 commits into
fix/workspace-session-isolationfrom
fix/remote-session-account-check

Conversation

@EhabY

@EhabY EhabY commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #1174. Not a prerequisite for #1168, so it can land after it.

#1174 cancels pending requests whenever the client rebinds. Remote windows there keep requests for any token on the same URL. This PR verifies the token's user first and closes the OAuth gap that lets an old account's refresh win.

Implementation decisions
  • The remote watcher looks up the user behind each new token with a throwaway client. Requests survive only when user ID and URL both match; an unknown previous user fails closed.
  • Each update aborts the previous one through an AbortController, so superseded or disposed lookups never apply credentials.
  • The initial user lookup can itself trigger an OAuth refresh, so updates await it rather than block it.
  • OAuthSessionManager.setDeployment compares deployment identity, so rebinding to a new account on the same URL aborts the in-flight refresh. A refresh aborted during its user lookup no longer persists, and only the current refresh clears the shared promise.

🤖 Generated with Claude Code

EhabY added 2 commits November 9, 2026 14:58
Rebinding the client to another deployment or account cancels its pending
requests, while token refreshes keep them. The auth interceptor no longer
refreshes, prompts or retries for a request canceled by a session change.
A remote window keeps pending requests only when a new token belongs to the
same user and URL; otherwise it rebinds and resets OAuth. A refresh canceled
during its user lookup no longer persists over replacement credentials.
@EhabY

EhabY commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Opened by mistake; the split was meant for #1168. #1174 is restored to its single commit.

@EhabY
EhabY force-pushed the fix/workspace-session-isolation branch from ae9c9e4 to 750c24d Compare November 9, 2026 12:01
@EhabY EhabY closed this Nov 9, 2026
@EhabY
EhabY deleted the fix/remote-session-account-check branch November 9, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant