Skip to content

Fix possible race condition that could lead to multiple didOpen's - #11120

Merged
Colen Garoutte-Carson (Colengms) merged 1 commit into
mainfrom
coleng/fix_processDelayedDidOpen_sync
Jun 23, 2023
Merged

Fix possible race condition that could lead to multiple didOpen's#11120
Colen Garoutte-Carson (Colengms) merged 1 commit into
mainfrom
coleng/fix_processDelayedDidOpen_sync

Conversation

@Colengms

Copy link
Copy Markdown
Contributor

I noticed this while reviewing #11085 , and had the mistaken impression that use of requestWhenReady would have addressed this.

Basically, the has check followed by the add is not 'thread'-safe if there is an await between those calls.

Added a call to takeOwnership instead of calling sendDidOpen directly, to ensure any other contents of takeOwnership also get called. (i.e. updateActiveDocumentTextOptions)

@Colengms
Colen Garoutte-Carson (Colengms) deleted the coleng/fix_processDelayedDidOpen_sync branch June 23, 2023 02:26
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 7, 2023
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.

3 participants