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

Crashes when the destination file exists, but wasn't created by this plugin #52

Open
wisp3rwind opened this issue May 6, 2020 · 1 comment
Assignees
Labels

Comments

@wisp3rwind
Copy link
Collaborator

As discussed in #48, beets-alternatives crashes with a traceback if for some reason (most likely a bug in the plugin itself, or maybe due to a crashed alt update which wasn't committed to the database) the destination file/link already exists, but wasn't created by the plugin itself. This came up in the review comment #48 (comment) with respect to SymlinkViews, but probably equally affects External and ExternalConvert collections. Possible paths forward:

  1. Keep everything as-is and crash, since this plugin always works under the assumption that the destination directory is exclusively managed by itself.
  2. Same as above, but log a warning instead and skip the affected item (or abort cleanly?). Minimum viable option IMO, any kind of crash has the potential to disrupt consistency between filesystem and beets' database.
  3. Same as above, but overwrite without asking.
  4. Query the user whether to replace the existing files. Probably not worth the effort and complexity in light of 1., see also @geigerzaehler's comments in the linked discussion in SymlinkView: Fix symlink removal (fixes #47) #48 (comment).
@geigerzaehler
Copy link
Owner

I’d go with 1) over 2). The main reason is that under these unexpected we want to notify the user early and visibly. We also want to avoid doing more work and potentially messing up things. As you rightfully pointed out we would need to ensure that the consistency is not worse than with 2).

However, I leave the decision between 1) and 2) up to you, @wisp3rwind.

@wisp3rwind wisp3rwind self-assigned this Jun 28, 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

2 participants