trame icon indicating copy to clipboard operation
trame copied to clipboard

Connection lost page should attempt a retry

Open banesullivan opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe.

The connection lost screen after killing/relaunching the server appears as though it is trying to reconnect with the spinning icon:

2022-09-16 16 28 10

But it actually does nothing (as far as I can tell). So I have to refresh the page.

Describe the solution you'd like

I'd like this to attempt to reconnect to my app and load when it's ready or not using this sort of misleading graphic

banesullivan avatar Sep 16 '22 22:09 banesullivan

So you are suggesting to have a different graphic in case of connection error?

(Just to be sure)

jourdain avatar Sep 16 '22 23:09 jourdain

So you are suggesting to have a different graphic in case of connection error?

Perhaps, but not quite.

I think this issue could go a couple of ways. The problem, IMO, is that this graphic is misleading about the behavior of the software. Rather than change the graphic, I'd like to change the behavior. However if we cannot change the behavior, then I think it is warranted to change the graphic.

IMO, this spinning graphic implies that the software is seeking a connection as spinning icons are ubiquitously used to indicate "loading". I would like for trame to implement some sort of functionality that attempts to reconnect to the app periodically while this icon is spinning such that the graphic's implication about what the software is doing is accurate/intuitive.

If this is too much work, then replacing the graphic with something more aligned with the "Connection lost" aspect of what it's trying to convey would be more appropriate. Something like (from random google image search):

2463100-200

banesullivan avatar Sep 20 '22 15:09 banesullivan

Also, a bit nitpicky, but "Connection Close" feels off to me... I would advocate for "Connection Lost" or "Connection Closed"

banesullivan avatar Sep 20 '22 15:09 banesullivan

The reconnect can be done but could trigger side effect when cloud deployment is used. But some option could be done when using localhost?

In case of websocket we can either get a close event or an error event. We just need to make sure to do a better job of conveying the proper message. The issue here is that I reused the loading widget to show error/close message rather than making a new widget for those.

jourdain avatar Sep 20 '22 16:09 jourdain

Added support for reconnect on trame-client==2.4.0. You can either add in the url a ?reconnect and you will get the error message along with a button to let you try to reconnect, or if you do ?reconnect=auto, the client will make 10 attempts to reconnect across 5 seconds.

jourdain avatar Dec 18 '22 22:12 jourdain

I'm having trouble using these new features... Prior to trame-client==2.4.0, I could close my laptop and loose connection. Now, with trame-client==2.4.0, after I close my laptop (to lose the connection) the view freezes (with or without the reconnect parameter) with no graphic or message about the connection status

banesullivan avatar Dec 20 '22 02:12 banesullivan

I guess you will have to show also I'm guessing the url you use is ...?ui=plot_id&reconnect not ?ui=...?reconnect?

jourdain avatar Dec 20 '22 03:12 jourdain

Correct. ...?ui=plot_id&reconnect and ...?ui=plot_id&reconnect=auto both have the same effect for me (frozen view on disconnect). I'll look at this again tomorrow with fresh eyes to make sure I'm not messing something up

banesullivan avatar Dec 20 '22 03:12 banesullivan

And the view freezes on disconnect now without the reconnect parameter

banesullivan avatar Dec 20 '22 03:12 banesullivan