Last modified: 2014-08-21 21:06:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67364, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65364 - mw.loader (with wgResourceLoaderStorageEnabled) fills up localStorage, preventing persistent writes by other code
mw.loader (with wgResourceLoaderStorageEnabled) fills up localStorage, preven...
Status: RESOLVED DUPLICATE of bug 64721
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.24rc
All All
: Normal major with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 65649 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-15 19:22 UTC by Ryan Kaldari
Modified: 2014-08-21 21:06 UTC (History)
13 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ryan Kaldari 2014-05-15 19:22:36 UTC
Right now, if I try to visit any page on English Wikipedia, I get a JS exception thrown:
[Exception... "Persistent storage maximum size reached"  code: "1014" nsresult: "0x805303f6 (NS_ERROR_DOM_QUOTA_REACHED)"  location: "<unknown>"]
This is despite the fact that I currently have nothing in localStorage for English Wikipedia and my localStorage quota is set to the default (5 MB).

I think what's going on is that Firefox is sharing localStorage space across all wikipedia.org sites, and since I have several ~1 MB MediaWikiModuleStores from other Wikipedias, it doesn't have room to store one for en.wiki. See https://support.mozilla.org/en-US/questions/963825 for someone else who noticed the same problem in Firefox but for a different website.

One possible semi-solution to this bug is discussed in bug 64721. Even if the size of MediaWikiModuleStore was reduced, however, you could still run into this problem if you visit enough Wikipedias.
Comment 1 Ori Livneh 2014-05-15 19:24:55 UTC
Thanks for the report. Apart from the error in the console, does JavaScript break?
Comment 2 Ryan Kaldari 2014-05-15 19:30:24 UTC
Javascript still seems to be working. For example, I can click the watchlist star and it functions as normal.
Comment 3 Derk-Jan Hartman 2014-05-16 12:21:39 UTC
@Ori, we should really move this into indexedDB, which has much bigger quota's.

We should have like a mw.storage.bigData (indexeddb with fallback to localStorage) and a mw.storage.smallData (localStorage with fallback to cookies (for wikieditor/collapsedstate of widgets etc).
Comment 4 Matthew Flaschen 2014-05-21 02:03:01 UTC
For context, testing by Rob and I (my testing was in Firefox) showed that it will still let you write after the storage fills up, but it is not guaranteed to be persistent.

So in an over quota scenario, $.jStorage.set (for example) will not throw, but on reload the data is gone.

I think this is what the error means exactly.  I.E. you can still call the localStorage API, but it is no longer *persistent* storage.
Comment 5 Ori Livneh 2014-05-21 02:14:30 UTC
(In reply to Derk-Jan Hartman from comment #3)
> @Ori, we should really move this into indexedDB, which has much bigger
> quota's.
> 
> We should have like a mw.storage.bigData (indexeddb with fallback to
> localStorage) and a mw.storage.smallData (localStorage with fallback to
> cookies (for wikieditor/collapsedstate of widgets etc).

Yeah, I think that's right. I'll research this a bit.
Comment 6 Matthew Flaschen 2014-05-21 04:32:59 UTC
> I think this is what the error means exactly.  I.E. you can still call the 
> localStorage API, but it is no longer *persistent* storage.

I was wrong before.  The browser did not have this behavior of letting localStorage work, but non-persistently.  Rather, this is part of jStorage's behavior.  It first writes it to in-memory (as Ori said), then attempts to save but suppresses any error (https://git.wikimedia.org/blob/mediawiki%2Fcore.git/ee5b96fe5df3bfdbc811259230d2f3da7e4ff1b6/resources%2Flib%2Fjquery%2Fjquery.jStorage.js#L444).

Related, if it can't save its test on initialization, localStorageReallyWorks will be false and it will fall back.  On a modern browser (i.e. no globalStorage or userData), this means it will be purely in-memory ($.jStorage.currentBackend() will be false)

Disclaimer: I was using a lower version of Firefox before (I actually upgraded to Firefox 29.0.1 so I could get it to stop on caught exceptions), but I'm pretty certain it was jStorage catching the error in both cases.
Comment 7 Ryan Kaldari 2014-05-21 18:59:58 UTC
Matthew Flaschen: That sounds right. When I was getting the localStorage full exception being thrown, it wasn't storing anything in localStorage, even temporarily.

Ori: Looks like the IndexedDB quotas are as follows:
Firefox: 50MB soft limit, asks for permission after that
Chrome: 10% of available disk space
Explorer: 10MB soft limit, asks for permission after that. 250MB per domain hard limit.
Comment 8 Bartosz Dziewoński 2014-05-22 20:11:59 UTC
*** Bug 65649 has been marked as a duplicate of this bug. ***
Comment 9 Helder 2014-07-09 22:08:20 UTC
Is there any way I can disable the MW feature which keeps using the storage to avoid this warning every time I debug a script in any WMF wiki?

"Storage error" load.php:161
"[Exception... "Persistent storage maximum size reached"  code: "1014" nsresult: "0x805303f6 (NS_ERROR_DOM_QUOTA_REACHED)"  location: "<unknown>"]" DOMException [NS_ERROR_DOM_QUOTA_REACHED: "Persistent storage maximum size reached"
code: 1014
nsresult: 0x805303f6
location: https://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.triggerQueueCallback%2CloadingSpinner%2CmwEmbedUtil%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20140706T172507Z:183]
Comment 10 Marius Hoch 2014-07-10 08:26:20 UTC
(In reply to Helder from comment #9)
> Is there any way I can disable the MW feature which keeps using the storage
> to avoid this warning every time I debug a script in any WMF wiki?

No... only thing you can try is disabling your localstorage entirely (not sure how that's handled in MW)
Comment 11 Krinkle 2014-07-15 20:17:10 UTC

*** This bug has been marked as a duplicate of bug 64721 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links