zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

Indicate server connectivity via heartbeat

Open neiljp opened this issue 5 years ago • 5 comments

This PR uses the automatic heartbeat event from the server to show the connectivity status in the bottom-right of the application.

Note that although the window says "Last server contact", this only updates on heartbeat events; we can change this to be more expressive/accurate, eg. trigger on every server event, or specifically say 'heartbeat' or similar.

I'm not sure that we handle reconnecting properly, but this gives an indication of whether things should be working, visually, which is perhaps not always obvious.

neiljp avatar Jan 23 '19 20:01 neiljp

  • "Last server contact: time (date)" format is too long. There is also text overflow in some long help text messages.
  • Just having a heartbeat reply from server doesn't mean things are going well. if we want to show user if he is connected properly to the server or not, we can use GREEN and RED DOT at the top before user name to indicate if he is connected or not(which we are perhaps already doing in USER PANEL??).

amanagr avatar Jan 24 '19 04:01 amanagr

@amanagr I understand there are concerns regarding this PR, and didn't expect it to be an easy merge :) I was mostly interested if we could use heartbeat events to give extra info on connectivity, both as a v1 user feature, and for debugging.

I am open to suggestions on a shorter format for the 'server contact' details.

I think it could be confusing to a user to indicate server connection/status through user status:

  • if the client is badly connected to the server, it should not be a small indicator next to the user showing this
  • if the client is badly connected, lots of things will be potentially out of date, including the presence list

neiljp avatar Jan 26 '19 18:01 neiljp

If we only want to show how recently things were updated, we can use updated 5s ago. This should serve the purpose right?

Then change it to Connection Error if things go wrong?

Also, note that it make ZT look like something which updates itself on constant intervals rather than something being continuously updated. 😅 (Not a concern for now BTW)

amanagr avatar Jan 27 '19 03:01 amanagr

I left it as just the time, as it wasn't clear to me at this point what 'go wrong' means, though I appreciate that 'updated' is simpler, if not necessarily any clearer.

neiljp avatar Jan 27 '19 07:01 neiljp

Heads up @neiljp, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

zulipbot avatar Apr 17 '20 00:04 zulipbot