2

Whenever I join a chat room, I notice that I have to refresh the page to see new messages. I would like to have real-time updates of chat messages, like you have proven feasible with most of the content on the Q&A section.

It works fine when I test in Firefox, but it isn't working in Safari 6. When I check the debugging console, I see that there are some errors:

Other error: An attempt was made to add something to storage that exceeded the quota.

I don't have any user scripts installed, and I have plenty of free disk space. What could be wrong?

If you can't display all the chat coming in, which is not done with comments, then would you please at least display a link if new chat messages are posted?

  • 5
    The storage quota is interesting (and probably the issue). Hang on; looking. – balpha Aug 2 '13 at 10:45
  • 1
    please try if it works now after reloading your chat page(s) – balpha Aug 2 '13 at 11:12
  • You did something? Sorry I can't test it right away, the guy will be back in half an hour. – tbodt Aug 2 '13 at 11:13
  • Okay, let me know after you've tested. – balpha Aug 2 '13 at 11:14
  • @balpha It now works perfectly in safari. What did you change? – tbodt Aug 3 '13 at 11:19
4

Is it possible you were using Safari's "private browsing" mode? It appears that this mode in Safari 6 allows reading the browser's localStorage but not writing to it.

In most places we already wrapped the localStorage.setItem() call in a try/catch block just to be sure, but in one important place we didn't. We checked for the presence of the localStorage, but once we saw it, we assumed we're fine to write to it (it's really unlikely that's we'd actually hit the quota, since that's usually 5 megabytes per origin, and we don't even get close to that).

When your browser receives a message from the server, it not only displays it, but also puts it into the storage so that other open chat tabs can see it and don't all have to talk to the server, thus saving bandwidth (both for you and for us).

But in this case, trying to save to the storage threw an exception, and this part of the "receiving a message" process happens before actually displaying the message. Thus you never saw them.

We now catch that exception, which fixes your issue.

Note that without a usable localStorage you're missing out on a few nice features like replying from the transcript, saving message drafts, and the above-mentioned cross-tab communication which also does things like dismiss messages in all tabs when you dismiss it in one. But for most of the chat functionality, the DOM storage is optional.

You must log in to answer this question.

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