Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix isInSync check to be with latest resource stat #8044

Merged
merged 1 commit into from
Jun 19, 2020
Merged

fix isInSync check to be with latest resource stat #8044

merged 1 commit into from
Jun 19, 2020

Conversation

amiramw
Copy link
Member

@amiramw amiramw commented Jun 18, 2020

Signed-off-by: Amiram Wingarten [email protected]

What it does

Solves race condition that happens when there are several consecutive calls to saveContentChanges.
Since before this fix, version was passed to isInSync before asynchronously calling getFileStat there were times when it was old on the sync check but current on this.version.
then onDidChangeContentsEmitter.fire was called wrongly.

Also there is no reason to pass a method with this.version as it can get it from the instance.

How to test

It's hard to reproduce the issue that was solved. Basically updating the resource content several times could cause sphoradic firing of the above event.

Review checklist

Reminder for reviewers

solves race condition that happens when there are several consecutive calls to saveContentChanges.
since before this fix, version was passed to isInSync before asynchronously calling getFileStat there were times when it was old on the sync check but current on this.version.
then onDidChangeContentsEmitter.fire was called wrongly

Signed-off-by: Amiram Wingarten <[email protected]>
@amiramw amiramw requested a review from akosyakov June 18, 2020 14:25
@akosyakov akosyakov added the filesystem issues related to the filesystem label Jun 19, 2020
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

let's try

@amiramw amiramw merged commit e2df385 into master Jun 19, 2020
@amiramw amiramw deleted the insync branch June 21, 2020 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filesystem issues related to the filesystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants