Re-connection bits

Hi Mohit,

  I merged the main chunk of work for auto-reconnection on connection loss. Good stuff, and a long-running problem.

  When https://gerrit.collaboraoffice.com/c/online/+/16070 is merged you can do:

  make run-proxy

  And then get a websocket proxy that disconnects uncleanly every 10 seconds - which is fun (it also wraps our coolwsd with its).

  As/when you've done some of the follow-on cleanup pieces I outlined; can you play with the make run-proxy case, and make it nicer.

  If I type in writer, I do re-connect quite nicely - but I loose focus - so my typing goes away (eg. :wink: which is deeply annoying - we should test and fix in all components, and with many contexts: shape editing etc. ( I suspect it is just a browser issue ).

  We should prolly instead of showing in the admin console come up with some transient warning when the connection disconnects and re-connects successfully - to annoy people mildly :wink:

  And we should test hard to see what other state we can preserve and re-use there.

  Nevertheless - I think this will be a big win for those who havn't managed to get their proxies setup properly - which is probably lots of them :slight_smile:

  Anyhow, nice work,

  Regards,

    Michael.

Nice to see auto-reconnect land. It’s the same problem space as Novastart, a collaborative infinite canvas we’re building, so a couple of thoughts for the follow-up on the focus loss:

  • It may help to treat focus as explicit state rather than relying on the DOM keeping it: note which editing context had focus (and the caret/selection) when the socket drops, then restore it once the reconnect handshake completes. That would cover shape editing and dialogs, not only the Writer canvas.
  • Keystrokes typed during the gap could be buffered client-side and replayed after reconnect, so the text doesn’t silently vanish.

+1 on a short transient notice instead of only the admin console. A quiet “Reconnected” message that fades after a few seconds explains why the cursor jumped without nagging anyone.