Fix stuck "Find All References" progress notifications on overlapping requests#14397
Fix stuck "Find All References" progress notifications on overlapping requests#14397Subham-KRLX wants to merge 1 commit intomicrosoft:mainfrom
Conversation
a749947 to
74cec67
Compare
74cec67 to
7ff1b6a
Compare
carsonRadtke
left a comment
There was a problem hiding this comment.
Just want to add some additional context here:
Note: Everything I'm describing is when pre-release (0.5.4) devtools is paired with pre-release (1.32.0) cpptools.
Requests from devtools should not be interacting with the UI; they should be using the new, silent, C_Cpp.FindAllReferences command meaning the UI progress dialog never appears. In an effort to make new devtools compatible with older cpptools, devtools asks vscode at extension startup if the C_Cpp.FindAllReferences command exists. If not, it falls back to vscode.executeReferenceProvider which issues UI progress updates.
What was happening is that vscode was loading devtools before cpptools. This was causing devtools to determine that C_Cpp.FindAllReferences didn't exist (because the command was not yet registered). This bug has since been fixed internally on the devtools side.
Now there is a question of what happens when devtools correctly identifies that it should fallback to vscode.executeReferenceProvider -- devtools may fire off several concurrent find all references requests which will trigger UI progress updates and some of them may get stuck. I believe this PR is still valuable in that scenario where new devtools are paired with old cpptools.
@bobbrow, WDYT - is this backwards compatibility something we wish to maintain?
@DavidARaygoza, is any additional context relevant on the internal devtools fix?
@sean-mcmanus, the parts of code that this diff touches are not familiar to me, but it seems OK. Requesting further review from you.
Closes #14381
Fixed a regression where overlapping "Find All References" requests (e.g., from DevTools) caused notifications to get stuck.
The fix ensures ReferencesManager properly clears previous timers and resolves active promises before starting a new request, preventing orphaned background loops. Verified via simulation.