-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Try persistent storage on Firefox #2623
Comments
Added Got it to work on desktop, though only after some time, not sure why : On mobile, I never got that popup, and the data doesn't show up in the Also, Bug : the sync finishes successfully and then the app seems to lose access to the indexedDB (500, The db itself doesn't look corrupted though: you can access it in console, get info, query views : |
@estellecomment There might be some weird restriction like it only works on localhost or https (it seems like all cool features are restricted like this these days). No idea why the indexed db went bad but it's probably related to the empty permanent folder? You're not running in private mode or something? I might have a look too and see if I can reproduce it. Also using the web worker is a big win for performance so I'll see if I can get the storage option passed through. |
It looks like the web worker is dropping the options we pass in, which explains why the auto compaction isn't working... |
It's dropping all except for the |
@estellecomment I've got persistent storage working for me. In my profile persistent storage is > 0 and temporary storage is empty. Once you've removed the web worker (or patched it to pass through storage) it should work. When I first tried I forgot to add it in both places that PouchDB is instantiated - did you remember to add the I've created an issue to fix this inconsistency: #2625 |
I'm getting fatal errors trying to get IDB working on Firefox mobile - I'm not even getting the prompt. My best guess is it's disabled for anything other than localhost or https. If I could find a way to do port forwarding like in Chrome I'd be good to go... If necessary we can update alpha.dev to try this stuff out in a real world situation. |
Aaaaaaaarrrrrrrrrghghghghhrrrrraaaarrrrrhhhh |
That explains why the replication would finish, and then the indexeddb would get corrupted. It's because the replication didn't use the persistent storage! Mystery solved. |
… for now. #2623 Web worker is disabled because it eats up the storage param. I'm committing this because I can't test locally, but will revert when I'm done.
Disabled pouch web worker to test on alpha.dev. |
Maybe we don't need persistent storage. Maybe on Firefox even default storage will allow unlimited usage. It looks like it may just prompt the user when 5MB is hit: http://www.html5rocks.com/en/tutorials/offline/quota-research/ . However this conflicts with Firefox's own documentation: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria Some testing required... |
You can go over 5MB on default storage on firefox, just tested that. You don't get a popup. |
Never trust documentation. |
I presume that was meant to read "You can't go over 5MB"? Because otherwise just use Firefox and we're done? |
What I mean is, there is no hard limit at 5 or 50MB. You don't get an error, you can go over, I tried that. That doesn't mean there's no limit at all :) But it's not hard-set at 5 or 50MB. |
Was this on mobile? If so it sounds like a Firefox PWA without persistent storage is the way to go. Persistent storage would be good but not necessary for increasing storage and we've had trouble getting it to work on mobile. |
There's still the quota depending on the free space. I haven't tested it on firefox. |
With 150MB of free space, and an app of 57MB, I'm not sure if I have a quota issue or not. I'm not sure what the quota issue looks like on Firefox mobile. The app is not throwing the "db connection is closing" errors, which is what chrome does over quota. To be sure I'd have to reproduce the quota issue with more free space, i.e. with a user that has more data than that. |
I think I have a pretty good handle on this now, after writing a quick script to interact with IndexedDB directly. Short answer: not great news. There are two documented ways I found to turn persistent storage on. MDN documents a variant of The second documented method of obtaining persistent storage is Chrome-specific – I also did a bunch of quota tests using One unknown piece of information remains IMO: assuming we were able to turn persistent storage on using a Google origin trial key, is the storage allowance unlimited? If not, what's the limit, and is it controllable via something like the quota API? My instinct is for us to hedge and start figuring out how to ship a bundled Chromium 52 with our container. The patch to give us special quota treatment would be relatively straightforward IMO, but the build process/tooling setup seems high-risk. |
Update: we have origin trial keys. I'll perform another round of quota tests using Chrome 52's |
No AT required. Looked at this along with @estellecomment |
Firefox has an API for persistent storage for IndexedDB :
https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria#Firefox_specifics
The text was updated successfully, but these errors were encountered: