-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Notify users when they're working offline #1773
Comments
There is an Ember addon that gets us 90% of the way there: https://github.com/BBVAEngineering/ember-network-state To Implement this, we'd need to:
init() {
let network = this.get('network');
network.on('change', state => {
if (state === "OFFLINE") {
//do something
}
})
} We could use something like https://github.com/poteto/ember-cli-flash to implement flash messages or roll our own |
You can also use PouchDB itself like this: We split sync in replicate.to and replicate.from to show the seperate upload and download indicators. See the red and green clouds here: https://bloggr.exmer.com/ It shows that users work offline even if internet is up, |
@broerse That's an even better approach! |
Does this issue is all about notifying the user that they are |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
1 similar comment
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'd like to help with this |
What of using the React detect offline library like this : https://github.com/chrisbolin/offline/blob/master/src/App.js For example:
In the |
@Kgwenzi Hi, thanks to pointing out this lib. For data persistency we use pouchdb, so saving part and sync when online is covered seamlessly. We can use |
And how should this message appear? |
@MatthewDorner I looked into using the pause/unpause events for determining if the db is syncing or not. Apparently these events are used for when the app connects/unconnects and when it starts syncing/some syncing. Do you have any experience with these events (or any others that might work)? It does have a “up” endpoint we could poll https://docs.couchdb.org/en/stable/api/server/common.html#get--_up. |
Just tested this, you get a There IS an |
Also if you supply https://stackoverflow.com/questions/26892438/how-to-know-when-weve-lost-sync-with-a-remote-couchdb EDIT: actually it's an
|
We still use the green and red clouds I pointed out before in this issue for many customers and they understand it. See https://bloggr.exmer.com/ |
@broerse I see, the |
@MathewDorner Ain't it possible to use the |
The desired behavior is:
Speaking of sync, we will address it in a separate issue as we need to work on the server side before deciding about FE. |
Hi, i used this on one of my projects, and it seems to work pretty well without the need of adding some kind of plugin
you can also subscribe to this event like that
https://caniuse.com/#feat=online-status 96 % global usage seems pretty good what do you think? |
I'm looking for a first ticket and I could pick this up based on RevIn9s' https://caniuse.com/#feat=online-status but what does it actually look like? Text was mentioned, but where would that go? Someone mentioned a cloud icon. |
I'd like to work on this. |
sounds good, @roy-stewart! |
Hi, I can help with this issue, I've implemented the same feature at work. |
Of course @alessioprestileo! |
The software has no way, as far as I have seen, for users to tell whether they're working offline or online. This could cause users to not notice if a server goes down or if a network connection is severed, potentially for a long time. Also it could lead to data loss if browser data is cleared either by mistake or if a user thinks it's synced with the server but is not, or obviously if a laptop is lost or HDD failure.
I suggest the frontend should display a bar at the top if it's working offline that says something like "OFFLINE: Unable to connect to server to save data. Erasing browser history will result in the loss of unsaved changes." or some other device to convey the same information.
The text was updated successfully, but these errors were encountered: