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

Can localStorage usage be completely turned off? #315

Closed
infinite-persistence opened this issue Feb 18, 2022 · 1 comment
Closed

Can localStorage usage be completely turned off? #315

infinite-persistence opened this issue Feb 18, 2022 · 1 comment
Labels

Comments

@infinite-persistence
Copy link

Question
I have storeFingerprintForResuming turned off and was assuming localStorage will no longer be used if so, and it seems like the case as I don't see any entries in devtools.

However, I'm seeing QuotaExceededError from some users:
tus: failed to upload chunk at offset 0, caused by QuotaExceededError: The quota has been exceeded., originated from request (method: PATCH...

I peeked at the code and don't think it is being used when storeFingerprintForResuming is turned off, but I'm not 100% sure. There is an initial test to see if localStorage is usable, but that's covered by a try-catch and is not part of the upload, so should be unrelated.

Does the tus-js-client need localStorage regardless, and if not, what else do I need to set to disable the use?

@Acconut
Copy link
Member

Acconut commented Feb 21, 2022

Are you using the findPreviousUpoads method? If so, that will also access localStorage, so please remove these calls.

If you want to be completely sure that localStorage is never accessed, you can pass an instance of NoopUrlStorage to the urlStorage option for the tus.Upload constructor:

export default class NoopUrlStorage {

Hope that helps!

infinite-persistence referenced this issue in OdyseeTeam/odysee-frontend Feb 22, 2022
I don't think it's being written when `storeFingerprintForResuming` is disabled, but doing the suggestion nonetheless.

`https://github.com/tus/tus-js-client/issues/315#issuecomment-1046821112`
tzarebczan referenced this issue in OdyseeTeam/odysee-frontend Feb 22, 2022
* Move into getLocalStorageSummary + always log

- Move into getLocalStorageSummary to clean up the clutter.
- Always log the localStorage info to get a bigger picture of what's going on with the QuotaExceededError.

* Remove 'findPreviousUploads' - we use the url stored in Redux.

Something I forgot to remove in the past. It also reads from localStorage, so remove since we are trying to avoid touching localStorage.

* Ensure localStorage is not used when uploading

I don't think it's being written when `storeFingerprintForResuming` is disabled, but doing the suggestion nonetheless.

`https://github.com/tus/tus-js-client/issues/315#issuecomment-1046821112`
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