This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Fix bug #6609 (Fast file replacement operations can be missed) #6615
Closed
Conversation
This file contains 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
added/removed lists - because there's a delay between the change occurring and the time we re-read the dir contents in response, we might see back-to-back changes (e.g. a delete-recreate pair) as a no-op even though something definitely changed. See #6609 for an example bug. Updated docs to clarify the two different special cases of directory change events. (Also contains an unrelated small docs improvement in FileUtils). ProjectManager already responds to this special case the way we'd want - it calls FileSyncManager and then does nothing else - so no code changes needed there.
@njx If you want to test this out. I'm still working on a unit test so we may want to hold off on merging though. |
Enhance MockFileSystemImpl to allow artificially delaying watcher notifications in addition to delaying normal callbacks.
Unit test added |
this._fireChangeEvent(entry, added, removed); | ||
} | ||
|
||
// We send a change even if added & removed are both length zero-length. Something may still have changed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "length zero-length"
Reviewed and tested - just found the typo. Need to retarget this PR at the release branch, though, and then merge it back into master. |
Closing in order to open a new PR against the release branch |
peterflynn
added a commit
that referenced
this pull request
Jan 23, 2014
Copy of PR #6615 for release branch
peterflynn
added a commit
that referenced
this pull request
Jan 23, 2014
Merge the copy of PR #6615 from release branch back to master
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fix bug #6609 --
Dispatch a FileSystem "change" event even when a dir change yields empty added/removed lists - because there's a delay between the change occurring and the time we re-read the dir contents in response, we might see back-to-back changes (e.g. a delete-recreate pair) as a no-op even though something definitely changed. See #6609 for an example bug.
Updated docs to clarify the two different special cases of directory change events. (Also contains an unrelated small docs improvement in FileUtils).
ProjectManager already responds to this special case the way we'd want - it calls FileSyncManager and then does nothing else - so no code changes needed there.