Repository navigation
Avoid token checking race condition in options - #10054
Conversation
There was a problem hiding this comment.
🟡 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.
Co-authored-by: fregante <[email protected]>
Co-authored-by: fregante <[email protected]>
|
@qasic have you had a chance to test this? I'd like to ship it as soon as possible. |
|
@fregante I'll be able to test it tomorrow. |
|
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 Tested on my end. The outdated 401 request still remains, but the UI status is correct 😄 Thanks for the change! |
Fixes #10014 and closes #10050