MacGapProject / MacGap1

Desktop WebKit wrapper for HTML/CSS/JS applications.
Other
3.55k stars 209 forks source link

Localstorage quota in mac app store builds #29

Open winterlightning opened 12 years ago

winterlightning commented 12 years ago

Running locally I am able to store as much data as I want but I am getting a data quota error when I build a version for the mac app store that stores something that is over 1mb. Here's the error:

QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.

liamks commented 12 years ago

method webView:frame:exceededDabaseQuotaForSecurityOrigin on line 82 of WebViewDelegate.m should be called in that situation. Could you add a breakpoint on line 84 and 86 and let me know what's going on?

winterlightning commented 12 years ago

The build works for me locally but not when it is installed on a separate computer via the pkg format. I'm not sure if I can do a breakpoint on a app store pkg.

I think my lack of ability to duplicate it might be because I'm running 10.7.2 instead of 10.7.3. I'll update my OS and retry.

Thanks for pointing me out to the code on that line though. I'll experiment with increasing the initial size and see if that helps me.

I'm putting an entire jpg file in there so it might also exceed the single record limit if there is one.

winterlightning commented 12 years ago

P.S. I looked over the code and it seems to be refering to websql. Are you sure it also applies to localstorage?

winterlightning commented 12 years ago

The localstorage limit problem still persists. I fixed this by rewriting my code to use websql instead.

I would recommend anyone who uses over 5mb to also do this.

drale2k commented 12 years ago

Hm, WebSQL is no longer being maintained in the spec but Safari does not support indexedDB yet.

liamks commented 12 years ago

@winterlightning localStorage has a 5MB limit. Is it possible that you saved more than 5MB worth of data? As far as I can tell the 5MB limit is part of the spec, and shouldn't be changed (not that I could find a way to change it). If you're storing things such as images, it might be better to save them to disk rather than store them in localStorage.

@drale2k yes, from my understanding WebSQL is not being maintained.