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

[Golden Retriever] Ability to clear upload history or set expiry date #324

Closed
sakozz opened this issue Sep 8, 2017 · 7 comments
Closed
Assignees
Labels
Feature 🐕 Golden Retriever Plugin that handles restoring after browser crash / accidentally closed tab

Comments

@sakozz
Copy link
Contributor

sakozz commented Sep 8, 2017

I have been testing Golden Retriever feature to restore files. I come to notice that it keeps history of all previous uploads. I was wondering if there is any proper way to clear the history or probably set some expiry date ?

@arturi
Copy link
Contributor

arturi commented Sep 8, 2017

Hi! Golden Retriever is in beta mode and history clearing / expiry date is on our todo. Likely coming to a next version of Uppy (or the one after it) close to you! PRs welcome :)

@arturi arturi self-assigned this Sep 8, 2017
@arturi arturi added Feature 🐕 Golden Retriever Plugin that handles restoring after browser crash / accidentally closed tab labels Sep 8, 2017
@goto-bus-stop
Copy link
Contributor

goto-bus-stop commented Sep 18, 2017

#349 will help with this by clearing files that are no longer related to any file in localStorage.

Two ideas for things we could do now:

  1. add a RestoreFiles.clear() method or something similar that removes all stored state and blobs for a given uppy instance ID, or for all instances, developers could use this manually, but I'm not sure how you would know when to clear
  2. add a timestamp to the blobs in IndexedDB, and perhaps localStorage state, so we can automatically delete stored state and blobs that are past their expiry date when an uppy instance loads. We could do this for all uppy instance IDs whenever any instance loads. That way blobs from other instances that haven't been used for 24+ hours or so are also cleaned up, even if the user hasn't visited that page again. Maybe just maybe we could provide this as a separate utility module so that people could import it across their entire website, even on pages that don't use uppy.

There's an issue here about adding expiration to other storage forms, including indexeddb, which would be super nice: https://git.io/v5bau
But in the mean time the above would help a lot.

@arturi
Copy link
Contributor

arturi commented Sep 18, 2017

👍

3. We should also listen for upload-complete and delete the uploaded file, right?

@goto-bus-stop
Copy link
Contributor

goto-bus-stop commented Sep 19, 2017 via email

@arturi
Copy link
Contributor

arturi commented Sep 19, 2017

But then there’s no way to get rid of complete uploads? I think, maybe, once complete, it’s safe to not show it at all?

@goto-bus-stop
Copy link
Contributor

goto-bus-stop commented Sep 21, 2017

Hmm yeah. I was thinking it'd make sense for thumbnails to keep showing if some of the files in a single upload() call succeeded, but others were still in progress.

we could address that more simply by listening for core:success instead though and delete all blobs for that upload instead of deleting the blobs individually.

@goto-bus-stop
Copy link
Contributor

Expiry has landed in #369. Files will automatically be deleted after 24 hours by default. Blog post + docs for clearing manually, and setting a custom expiry timeframe, are coming up soon. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature 🐕 Golden Retriever Plugin that handles restoring after browser crash / accidentally closed tab
Projects
None yet
Development

No branches or pull requests

3 participants