ssimeonoff/ssimeonoff.github.io

Cannot download game stats anymore

StatisMike opened this issue · 3 comments

After clicking Fetch new games at /stats no new games are fetched. The number stops at 10701 games. It seems to be related to the database being downloaded to the localStorage - it seems to exceed the limit on the localStorage size.

firebase.js:1 [2022-09-24T16:32:32.930Z]  @firebase/database: FIREBASE WARNING: Exception was thrown by user callback. Error: Failed to execute 'setItem' on 'Storage': Setting the value of 'games' exceeded the quota.
    at https://ssimeonoff.github.io/js/stats.js:75:20
    at https://www.gstatic.com/firebasejs/5.5.0/firebase.js:1:255166
    at exceptionGuard (https://www.gstatic.com/firebasejs/5.5.0/firebase.js:1:212383)
    at e.raise (https://www.gstatic.com/firebasejs/5.5.0/firebase.js:1:313960)
    at e.raiseQueuedEventsMatchingPredicate_ (https://www.gstatic.com/firebasejs/5.5.0/firebase.js:1:313561)
    at e.raiseEventsAtPath (https://www.gstatic.com/firebasejs/5.5.0/firebase.js:1:313129)
    at e.addEventCallbackForQuery (https://www.gstatic.com/firebasejs/5.5.0/firebase.js:1:360121)
    at e.onValueEvent (https://www.gstatic.com/firebasejs/5.5.0/firebase.js:1:259485)
    at e.on (https://www.gstatic.com/firebasejs/5.5.0/firebase.js:1:259276)
    at getFirebaseGames (https://ssimeonoff.github.io/js/stats.js:72:47) 

After cleaning the games key, no data is being shown at all - the problem persists.

It is due to hitting the limit of the database traffic.

@ssimeonoff If it was the case, then I think that the Download the database button wouldn't work either. But it works - the file has a little over 5 MB, which indicates that the problem is stemming from localStorage problem I've described above.

As I am using Chrome, the localStorage quota is hard-coded and can't be changed (see the first answer):
https://stackoverflow.com/questions/5663166/is-there-a-way-to-increase-the-size-of-localstorage-in-google-chrome-to-avoid-qu

@StatisMike,
The button "download" just puts what you have in local storage into a file.
The button "fetch" gets all games from Firebases and puts them in local storage.

Since now the game are way too many, clicking "fetch" throws Failed to execute 'setItem' on 'Storage': Setting the value of 'games' exceeded the quota because the 12k games are too many.