Skip to content

Fix race condition with restoration of problems when closing a file - #183271

Merged
Megan Rogge (meganrogge) merged 2 commits into
microsoft:mainfrom
russelldavis:fix-problem-restoration-race-condition
Dec 19, 2023
Merged

Fix race condition with restoration of problems when closing a file#183271
Megan Rogge (meganrogge) merged 2 commits into
microsoft:mainfrom
russelldavis:fix-problem-restoration-race-condition

Conversation

@russelldavis

Copy link
Copy Markdown
Contributor

Fixes #47386

This sets the flushOnListenerRemove option to true for the call to Event.debounce. Without this, some onMarkerChanged events can get dropped -- specifically, when an event gets fired more than 100ms after first listening, in which case the 600ms cleanup setTimeout fires while the 500ms debounce timeout is still pending.

Because of the race condition, the fix for #116760 applied at df97bc3 would only work intermittently.

cc Megan Rogge (@meganrogge) (looks like you were assigned to my previous attempt to fix this at #183172)

Fixes microsoft#47386

This sets the `flushOnListenerRemove` option to true for the call to
Event.debounce. Without this, some `onMarkerChanged` events can get
dropped -- specifically, when an event gets fired more than 100ms after
first listening, in which case the 600ms cleanup setTimeout fires while
the 500ms debounce timeout is still pending.

@meganrogge Megan Rogge (meganrogge) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you!

@mjbvz Matt Bierner (mjbvz) modified the milestones: November 2023, December 2023 Nov 30, 2023
@meganrogge
Megan Rogge (meganrogge) merged commit b80a1c7 into microsoft:main Dec 19, 2023
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task: Typescript errors disappear after document closed

5 participants