Repository navigation
Conversation
…r it Photoshop and most image editors save by writing a temp file and renaming it into the original's place, so the watcher sees the name deleted and created again inside one 300 ms batch. Deletes were applied after every create, and a create of a name still listed was skipped, so the file dropped off the list. The batch is now replayed in order and only the net change is applied; a saved-over entry keeps its place and gets the new file as its source. The test uses Windows' real watcher on four ways of saving over a file (rewrite, temp + delete + rename, rename away + rename in, File.Replace). All four failed before.
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
hey, this one matters more now that project folders are the default way to work. open a texture from a project folder in Photoshop (or most image editors), save it, and the file disappears from the pack explorer, even though it's still on disk
those programs save by writing a temp file and renaming it over the original, so the folder watcher sees the name deleted and created again inside one 300 ms batch.
ProcessPendingEventsapplied every delete after every create, and a create of a name that was still listed got skipped, so what was left was the deletenow the batch is replayed in order against the listed names and only the net change is applied. a file that got saved over keeps its entry and gets the new file as its source, and a temp file that comes and goes inside the same batch is never added
files
Shared.Core/PackFiles/Models/Containers/SystemFolderContainer.cs: the batch handling inProcessPendingEventsand its two private helpers, no API changeShared.CoreTest/PackFiles/Models/Containers/SystemFolderContainerTests_RealWatcher.cs: newtesting
FileSystemWatcherWrapper), not the mock, on four ways of saving over a file: delete then rewrite, temp + delete + rename, rename away + rename in + delete the backup, andFile.Replace. against the current code all four drop the file. with this change all four pass, 10 runs in a row hereShared.CoreTest: 426 passed, 0 failed, 6 skipped (the existingAssert.Ignores in the pack container tests)AssetEditor.csprojthe waypr-test.ymldoes, 0 errors