shout icon indicating copy to clipboard operation
shout copied to clipboard

Client offline support

Open dbkaplun opened this issue 10 years ago • 6 comments

Right now if I come back to my computer after a while of being disconnected from the Internet I get a Chrome error page.

dbkaplun avatar Jun 03 '15 23:06 dbkaplun

Hi @dbkaplun, I'm not sure I understand your problem. Could you describe your situation and issue in more details please? For example, is Shout on your laptop or on a server? What is your configuration? Is it a private or public instance? Do you have an explicit error message? ... Basically any information will be useful!

astorije avatar Sep 26 '15 00:09 astorije

Chance are the OP is only referring to the fact that, when you are connected to shout on your web browser and lose your internet connection (internet goes off, computer goes to sleep, etc.), the connection to shout is lost and you are forced to refresh the page.

capture

A more gracious way to handle that would be to provide an error message within shout and offer an option to refresh, or refresh automatically until internet access is resumed.

TheSonAlsoRises avatar Sep 27 '15 06:09 TheSonAlsoRises

Or just retry the connection until it works.

Xe avatar Sep 27 '15 06:09 Xe

Alright, I see now. I wasn't bothered so far as refreshing pages is an automatism when I come back :-) Marking this as a bug. Yep, disabling input and retrying connection might do, but there are a few solutions to make sure UX is at its best.

astorije avatar Sep 27 '15 17:09 astorije

I'm looking at this, because offline support is something I really want as well. It's really annoying (especially on mobile when I'm on the train as it doesn't have great service).

Thought I would put down what I'm doing to do this to see if anyone has any objections to the way I'm taking so far.

First of all, I've disabled the automatic refresh when socket.io gets disconnected from the server. This stops the page dying as soon as we lose internet (because socket.io actually handles reconnecting). So now, the page only refreshes automatically when we need to authenticate.

Next, I'm going to add a small notification somewhere to say that we are offline, so that users know and they don't try and send any messaegs and get annoyed when they don't send.

Then I'll add a serviceworker so that the user can refresh the page and get back to view the most recent messages and send a message, and it gets sent when we get internet again.

There are 2 issues with this:

  1. Service workers work only with https, and I'm sure lots of shout instances without https. Can we add a recommendation somewhere that people use https to encourage adoption?
  2. Service workers are only supported in Chrome and the next version of Firefox.

To combat these 2 issues, I might set up an application cache as well. Although it's deprecated, it's probably best to support the widest range of browsers and shout instances. But I'll probably do that last.

Any thoughts or objections on all of this?

AlMcKinlay avatar Jan 13 '16 06:01 AlMcKinlay

Sounds good to me!

polux avatar Apr 22 '16 14:04 polux