Honor globalState cache in getAssignable/MentionableUsers when a fetch is already in flight#8715
Draft
Honor globalState cache in getAssignable/MentionableUsers when a fetch is already in flight#8715
Conversation
…omise exists Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/6fa0d829-6819-4faf-8e7c-efa3758b29cd Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix cache bypass bug in getAssignableUsers and getMentionableUsers
Honor globalState cache in getAssignable/MentionableUsers when a fetch is already in flight
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getAssignableUsers()andgetMentionableUsers()infolderRepositoryManager.tsreturnedglobalStateCache ?? fetchPromiseon the first call, but on subsequent calls (when_fetchPromisealready existed from a prior invocation) they returned the pending promise directly, bypassing the disk cache and forcing the UI to block on the network — most noticeably aftergetAssignableUsers(true)clears the in-memory cache while a fetch is still in flight.Changes
src/github/folderRepositoryManager.ts: align the fallback return on the "fetch already in progress" path with the first-call path so both methods consistently prefer the globalState cache:globalStateMentionableUsers/globalStateAssignableUsersare already loaded immediately above each return, so this is a pure correctness fix with no extra I/O. Background refresh behavior is unchanged — concurrent callers now get the cached value instantly while the existing fetch promise continues to update the in-memory and globalState caches when it resolves.