11

TL; DR: Each late answer you're reviewing (hitting I'm Done or Not Sure) is stored in session. After a few reviews, the session becomes so huge, that Chrome throws up an error.


On the /review/late-answers, it seems that the review system uses the browser Session Storage to keep a history of what I've reviewed.

It seems that I'm reviewing too many late answers, because I constantly have an incremental JS error about the exceeded quota of session storage (full image):

enter image description here

Regarding this question/answer, it may come from the localStorage.

If I took a look on what SO stores on my browser, I saw one localStorage and one Session Storage. Inside Session Storage, there is History.store, which seems to be huge...

I wasn't able to find the size of it using sessionStorage.getItem('History.store').length because ... it was too huge I think.

I know it won't be easy to reproduce the bug because you'll have to review quite a few answers to have this kind of size for your session storage.

By the way, I closed the tab and re-opened a new one, and the problem was gone.

But I finally came back to see what's going on. I dug into the History.store and I found that every time you click on I'm Done or Not Sure, the size of the session increases by ~30.000, which seems to be the session of each information related to an answer (information, id, link, content, etc ...):

sessionStorage.getItem('History.store').length
33878

XHR finished loading: "https://stackoverflow.com/review/task-reviewed"
XHR finished loading: "https://stackoverflow.com/posts/5435516/votes?_=1348599149396"
Uncaught ReferenceError: votesCast is not defined cdn.sstatic.net/js/full.js?v=038e537afd9e:124
sessionStorage.getItem('History.store').length
65336

XHR finished loading: "https://stackoverflow.com/review/inline-edit-post?id=12374482&improve=false&reviewTaskId=679498&_=1348599161672"
XHR finished loading: "https://stackoverflow.com/posts/12374482/edit-submit/1ab5b877-d63f-499b-9ae1-7a00c8f23feb"
XHR finished loading: "https://stackoverflow.com/review/next-task"
XHR finished loading: "https://stackoverflow.com/posts/5435516/votes?_=1348599178478"
Uncaught ReferenceError: votesCast is not defined cdn.sstatic.net/js/full.js?v=038e537afd9e:124
sessionStorage.getItem('History.store').length
65336

XHR finished loading: "https://stackoverflow.com/review/task-reviewed"
XHR finished loading: "https://stackoverflow.com/posts/9623671/votes?_=1348599187508"
Uncaught ReferenceError: votesCast is not defined cdn.sstatic.net/js/full.js?v=038e537afd9e:124
sessionStorage.getItem('History.store').length
99372

By the way, you'll notice the Uncaught ReferenceError, but it's not blocking.

I continued to review a few other answers, and then came back to see my dear friend History.store:

sessionStorage.getItem('History.store').length
1565179

There are around 51 answers inside the session, and I guess there is too much information. Even JsonLint.com can't handle the size :)

Inside this huge JSON, you are repeating some information, like this part for each answer:

"instructions": "This is a <strong>late answer to an old question</strong> provided by a new user. Watch for hidden gems, non-answers, and spam.",
"moreInstructions": "<p><strong>I'm Done</strong> is only available if you've done one of the following:</p><ul><li><strong>Vote up or down</strong> to rate the answer's helpfulness</li><li><strong>Edit</strong> to improve the answer's appearance, clarity, or accuracy</li><li><strong>Comment</strong> to leave constructive feedback for the author, or vote up existing comments</li><li><strong>Flag</strong> to notify the moderators of serious problems</li></ul><p>When in doubt, click <strong>Not Sure</strong> if you are unsure and want to skip this answer.</p>\r\n",
"actions": [
    {
        "name": "I'm Done",
        "tooltip": "done reviewing this answer",
        "disabled": true
    },
    {
        "name": "Not Sure",
        "tooltip": "skip this answer",
        "disabled": false
    }
],

which can be, obviously, factorized. You also store the whole content of the answer, which increases the size of the session.

Anyway, I think you should reduce the information you are storing inside the session. I guess you're using it to speed up the review, but it can become "useless" if the session is full. That's my case.

1
  • 1
    Interesting.. right off the bat, I can see that we're inadvertently storing a ton of unnecessary stuff via the history plugin we're using. But I'll try to get a repro first so I can test a fix.
    – Emmett
    Sep 25, 2012 at 19:32

1 Answer 1

7

We were inadvertently pushing a ton of junk into the sessionStorage by way of the html5history plug-in we're using. It's fixed now, so hopefully you won't see this error any more.

4
  • Great, you are storing less data. But I still have the Uncaught ReferenceError: votesCast is not defined
    – j0k
    Sep 27, 2012 at 7:27
  • That should be fixed now too. Thanks for the tip.
    – Emmett
    Sep 27, 2012 at 18:35
  • 1
    Just curious - what did you do to fix this? We're also using history.js and I was wondering if you've just stopped using it, or you modified history.js to be less of a space hog (or to just not use sessionStorage)?
    – billmag
    Jan 9, 2013 at 22:34
  • @billmag It wasn't a problem with the plug-in, just a bug in our code.
    – Emmett
    Apr 18, 2013 at 18:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .