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

Renamed temporary files cause issues #26

Closed
DragonQ opened this issue Jun 4, 2020 · 1 comment
Closed

Renamed temporary files cause issues #26

DragonQ opened this issue Jun 4, 2020 · 1 comment
Labels

Comments

@DragonQ
Copy link
Owner

DragonQ commented Jun 4, 2020

Consider the following edge case:

  • SrcFileA has been renamed to SrcFileB.
  • SrcFileB matches configured tags so should be synced.
  • SyncFileA doesn't exist.

The current behaviour is to attempt to transcode SrcFileB to SyncFileB. This works fine, unless the following is also true:

  • SyncFileB already exists.

In this case, the application hangs (if transcoding) or fails to transcode (if copying).

This can happen if the "rename" event is actually an "overwrite" event. Since there's no distinction in the FileSystemWatcher between these two types of events, we need to deal with it ourselves. This has been seen to happen when Foobar changes a file's tags: it creates a new temporary file (SrcFileA in this case) and then renames that temporary file to the original file's name (SrcFileB), overwriting it.

The fix is to delete SyncFileB before attempting to copy/transcode SrcFileB, if it exists.

DragonQ added a commit that referenced this issue Jun 4, 2020
…cation to hang.

If SrcFileA has been renamed to SrcFileB, SyncFileA doesn't exist, but
SyncFileB does exist, the application now deletes SyncFileB before
continuing.
@DragonQ DragonQ added the bug label Jun 6, 2020
DragonQ added a commit that referenced this issue Jun 6, 2020
@DragonQ
Copy link
Owner Author

DragonQ commented Jun 6, 2020

Fixed in v1.3.1.

@DragonQ DragonQ closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant