-
Notifications
You must be signed in to change notification settings - Fork 2k
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
restore: Auto-clean old blobs from IndexedDB #369
Conversation
Added It's not super tiny unfortunately, about 5kB after gzip: $ browserify src/plugins/RestoreFiles/cleanup.js -t babelify | uglifyjs -cm | gzip | wc -c | npx pretty-bytes-cli
4.8 kB |
4b2c0b7
to
80e4a5b
Compare
examples/bundled-example/sw.js
Outdated
sendMessageToAllClients({ | ||
type: 'uppy/HERE_I_AM' | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MDN said something about using clients.get(event.clientId)
to only send the message back to the sender, but clientId
was undefined for me--i guess that's why we were sending the uppy/ALL_FILES
message to all clients too.
In docs, we are using both |
Ah good catch! yeah that's most likely it. e; it was the database migration (adding timestamps to existing blobs) failing if there were no blobs stored. fixed in 68d533e
hmm, the reason i use RestoreFiles in docs is because that's the path you have to |
68d533e
to
fdf46b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woot woot! Very impressive! Tested, clean up succeeded after recent updates ✔️
A thought about serviceWorker
: I think it might stick around forever if you don’t restart the browser, and on mobile its literally forever, because that’s how it’s designed to work. So I think adding expiration dates to serviceWorker
is a good idea too.
…ng it" This wasn't reliable enough unfortunately. This reverts commit 80e4a5be8e23a585782b48fb275524ef27fbf2b1.
0bd8b5b
to
b66bfde
Compare
Steps:
Core
dependency from IndexedDBStore and ServiceWorkerStoreNote that this removed the need for users to fire the
sw-ready
event, the ServiceWorkerStore now detects whether a serviceWorker is installed on its own.