zulip / zulip-terminal

Official Zulip terminal client.
Apache License 2.0
650 stars 249 forks source link

ZT freezes when connection is lost till you get connection again. #1381

Open Sushmey opened 1 year ago

Sushmey commented 1 year ago

ZT 0.7.0 (server version 6) either freezes when connection is lost and doesn't display any error till you get connection back or connection times out. Happens when you try to view full raw message through the message information popup, might happen for other actions which require communication with the server.

Steps to recreate:

  1. Open ZT
  2. Turn off your Internet
  3. Open message information popup with i -> view full raw message with r
fabianscode commented 11 months ago

I'd like to work on this. I was thinking of a notification like 'connection lost' when this occurs. Any thoughts on that? Currently, there are multiple 'vulnarable' places on model.py and I check them individually (e.g. get_messages() and poll_for_event(). Is there a better way than checking each one?

neiljp commented 10 months ago

@fabianscode Apology for the delay in responding, this ended up buried in my email.

For this issue, we can finalize the specific behavior and text output at a later stage. Initially I would suggest applying one approach to only one endpoint, that is easily initiated by a user, for simpler testing.

If we have a working way to show disconnection and reconnection, for example, we can then discuss further how we want to represent that, as well as other aspects such as if we wish to enable operation of ZT even if it is disconnected.

From the above, I'd suggest that the server events are not a good place to start, since there is a lot of surrounding logic. In addition, while server reconnection should generally work - and we can aim to notify in a similar way to other endpoints when we know we're disconnected - there is also quite a bit of overall server disconnection/reconnection logic that may need improving generally to ensure our data is up to date in the model and the UI.

This could also relate to #1270, which is specifically for a network timeout.

0xUgochukwu commented 7 months ago

I see it's been a while and there's no update on this @neiljp I'll like to work on this if it hasn't been fixed, please confirm it hasn't so I can begin working on it

neiljp commented 6 months ago

@0xUgochukwu and any others interested: this has been discussed in # zulip-terminal > ZT freezes while connection is lost #T1381. Anyone with specific suggestions is welcome to get involved starting there - to obtain a more specific plan for implementation.

@Sushmey has explored this and made some suggestions, but hasn't pushed any code as of now.

0xUgochukwu commented 6 months ago

alright, i’ll take look at the discussions and also ask some questions to obtain a specific plan for implementation and get to work