fix: flush pending changesets immediately after reconnect

After reconnecting, setUpSocket() did not call handleUserChanges(),
so any edits made while disconnected were not sent to the server until
the user made another change. This caused divergent pad state between
users.

Now calls handleUserChanges() after reconnect to immediately transmit
any pending local changesets.

Fixes #5108

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
John McLear 2026-04-04 19:06:05 +01:00
parent bd73785431
commit 09d81c01a7

View file

@ -154,6 +154,12 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
doDeferredActions();
initialStartConnectTime = Date.now();
// Flush any pending local changes immediately after (re)connect.
// Without this, changes made while disconnected are not sent to the
// server until the user makes another edit.
// See https://github.com/ether/etherpad-lite/issues/5108
handleUserChanges();
};
const sendMessage = (msg) => {