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

Sync crashes with "Failed to get thumbnail" #54

Open
TheZoq2 opened this issue Aug 30, 2018 · 1 comment
Open

Sync crashes with "Failed to get thumbnail" #54

TheZoq2 opened this issue Aug 30, 2018 · 1 comment

Comments

@TheZoq2
Copy link
Owner

TheZoq2 commented Aug 30, 2018

This most likely originates from thumbnail generation having failed without nulling the db entry thumbnail field.

@TheZoq2
Copy link
Owner Author

TheZoq2 commented Aug 30, 2018

It seems like thumbnails are never None since thumbnail generation happens after storing the thumbnail name.

A possible 2 phase solution to this might be:

Phase 1

If thumbnail fetch returns an error. Ignore the file and store it anyway

Phase 2

Option 1

Figure out a way update db entries once thumbnails have been generated. There are several options for this:

Separate thumbnail table

Make thumbnails a Maybe one-to- maybe one mapping in the database. Generate a thumbnail ID that gets passed to both the generator and database and add them separately.

Pros:

  • Simple implementation
    Cons:
  • Same problem might happen for files
  • Requires schema change

Add db entries after all tasks are done

Instead of starting worker threads for doing long winded operations when adding files but adding files immediately, use a job system similar to the way sync progress is handled.

Pros:

  • No schema change
  • Solves potential data inconsistency
    Cons:
  • Tricky rewrite
  • Requires a UI for reporting results to user
  • More indirection with annoying error handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant