Skip to content

Avoid token checking race condition in options - #10054

Merged
fregante merged 6 commits into
mainfrom
fregante-patch-1
Sep 12, 2026
Merged

fregante merged 6 commits into
mainfrom
fregante-patch-1

Conversation

@fregante

@fregante fregante commented Sep 6, 2026

Copy link
Copy Markdown
Member

Fixes #10014 and closes #10050

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Stale validations can still trigger section-expansion side effects for a previously selected domain.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Refactors token validation to let Svelte ignore stale promises when switching GitHub Enterprise domains.

Changes:

  • Returns structured validation results instead of mutating shared state.
  • Renders status and scopes through Svelte await blocks.
File summaries
File Description
source/options/token-input.svelte Refactors asynchronous token validation and rendering.
Review details

Suppressed comments (1)

source/options/token-input.svelte:83

  • A rejection from an obsolete validation also reaches this side effect even though Svelte suppresses its stale UI result. When switching domains, a late failure for the old host can therefore reopen the current host’s token section. Apply the same active-validation guard here before expanding.
			expandTokenSection();
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread source/options/token-input.svelte Resolved
@fregante
fregante marked this pull request as ready for review September 9, 2026 05:34
@fregante

fregante commented Sep 11, 2026 •

Copy link
Copy Markdown
Member Author

@qasic have you had a chance to test this? I'd like to ship it as soon as possible.

@qasic

qasic commented Sep 11, 2026

Copy link
Copy Markdown

@fregante I'll be able to test it tomorrow.

@fregante

Copy link
Copy Markdown
Member Author

The widget still works and there are a few code improvements, so I'm going to merge this anyway. Let me know if it fixes the issue soon so if it doesn't I can reopen your issue and PR

@fregante
fregante merged commit d599649 into main Sep 12, 2026
14 checks passed
@fregante
fregante deleted the fregante-patch-1 branch September 12, 2026 05:58
@qasic

qasic commented Sep 12, 2026

Copy link
Copy Markdown

@fregante Tested on my end. The outdated 401 request still remains, but the UI status is correct 😄

Thanks for the change!

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

Labels

Development

Successfully merging this pull request may close these issues.

Race condition in token validation when choosing between multiple GHES

4 participants