etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

Etherpad shutdown does not display disconnect info - information is just lost

Open SamTV12345 opened this issue 1 year ago • 8 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Spin up a 2.x Etherpad instance
  2. Access any pad
  3. Stop the server
  4. Nothing is displayed and you can still type

Expected behavior You should see a reconnect symbol and shouldn't be able to write anymore

SamTV12345 avatar Jun 08 '24 22:06 SamTV12345

was trying to reproduce this and with latest I do see a message: image It just takes almost 30 seconds to show

testing next on your branch to see the new behavior

heldersepu avatar Jun 22 '24 16:06 heldersepu

Here is what I see now:

image

It says Reconnecting to your Pad but is it really reconnecting? If I restart the server nothing really changes, also if we tab away the "Reconnecting" popup goes away and we get is a "frozen" pad where we can't type

heldersepu avatar Jun 22 '24 16:06 heldersepu

See these short clips of the two different behaviors:

latest

We can see in the console that it is trying to reconnect, and after some attempts the You have been disconnected pops up and that stays open no matter what we try, we can move to another tab or click around the message stays.

https://github.com/ether/etherpad-lite/assets/545474/c2d73bfc-5208-48af-b165-f9a0337de502

silent-disconnect

With this branch the message Reconnecting to your pad... comes up right away, but the console does not show any attempt at reconnecting, I could turn the server back on but nothing changes, and if we move away from the tab the message goes away, and end user might think that it did reconnect but the UI is locked
https://github.com/ether/etherpad-lite/assets/545474/b67407a1-ff89-4d65-b1ac-ad574b1811a3

my 2-cents

I think is OK to silently try to reconnect a couple of times, latest is certainly trying too many times before we show the user some info, but if we are going to show a Reconnecting to your pad... it should really be trying to connect and the message should stay maybe after a few more tries show the same force button

heldersepu avatar Jun 22 '24 21:06 heldersepu

If I'm reading the code correctly the existing retry behavior happens here:

https://github.com/ether/etherpad-lite/blob/b2be2ca71464f4da4852b9218d871adee04d194d/src/static/js/collab_client.js#L76-L104

maybe we should expose all those hardcoded values in the settings:

  • How long between retry
  • How long to wait before we show Reconnect message

heldersepu avatar Jun 22 '24 21:06 heldersepu

If I'm reading the code correctly the existing retry behavior happens here:

perhaps is not there but here:

https://github.com/ether/etherpad-lite/blob/b2be2ca71464f4da4852b9218d871adee04d194d/src/static/js/pad.js#L219-L227

... or a combination of both places

heldersepu avatar Jun 23 '24 02:06 heldersepu

If I'm reading the code correctly the existing retry behavior happens here:

https://github.com/ether/etherpad-lite/blob/b2be2ca71464f4da4852b9218d871adee04d194d/src/static/js/collab_client.js#L76-L104

maybe we should expose all those hardcoded values in the settings:

  • How long between retry
  • How long to wait before we show Reconnect message

The question would be how to sync those changes. For the settings sync to the client there needs to exist a socket io connection.

SamTV12345 avatar Jun 23 '24 09:06 SamTV12345

See these short clips of the two different behaviors:

latest

We can see in the console that it is trying to reconnect, and after some attempts the You have been disconnected pops up and that stays open no matter what we try, we can move to another tab or click around the message stays.

Kazam_screencast_00013.mp4

silent-disconnect

With this branch the message Reconnecting to your pad... comes up right away, but the console does not show any attempt at reconnecting, I could turn the server back on but nothing changes, and if we move away from the tab the message goes away, and end user might think that it did reconnect but the UI is locked https://github.com/ether/etherpad-lite/assets/545474/b67407a1-ff89-4d65-b1ac-ad574b1811a3

my 2-cents

I think is OK to silently try to reconnect a couple of times, latest is certainly trying too many times before we show the user some info, but if we are going to show a Reconnecting to your pad... it should really be trying to connect and the message should stay maybe after a few more tries show the same force button

I'm wondering why it is not working anymore. Normally the connect logic should be the same. Only the message changed. Do you have time to follow this up with a pr?

SamTV12345 avatar Jun 23 '24 09:06 SamTV12345

Do you have time to follow this up with a pr?

I'm still thinking about the best user experience... I do not like the "in your face" popup and frozen UI as soon as a connection is lost, maybe we show a small red label on the toolbar when a disconnection is detected, and just keep the existing "you have been disconnected" message

heldersepu avatar Jun 24 '24 01:06 heldersepu

Do you have time to follow this up with a pr?

I'm still thinking about the best user experience... I do not like the "in your face" popup and frozen UI as soon as a connection is lost, maybe we show a small red label on the toolbar when a disconnection is detected, and just keep the existing "you have been disconnected" message

Hopefully this is fixed with the latest develop version. I'll create a release for that.

SamTV12345 avatar Jul 07 '24 18:07 SamTV12345