mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-05 04:06:37 +02:00
fix: flush pending changesets on actual reconnect, not just initial connect
setUpSocket() only runs during initialization. Move handleUserChanges() to the reconnect code path so pending edits are flushed when the connection is re-established. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4922d73a6b
commit
a7c0e07d8f
@ -152,7 +152,6 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||
const setUpSocket = () => {
|
||||
setChannelState('CONNECTED');
|
||||
doDeferredActions();
|
||||
handleUserChanges();
|
||||
|
||||
initialStartConnectTime = Date.now();
|
||||
|
||||
@ -364,6 +363,11 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||
if (newChannelState !== channelState) {
|
||||
channelState = newChannelState;
|
||||
callbacks.onChannelStateChange(channelState, moreInfo);
|
||||
if (channelState === 'CONNECTED') {
|
||||
// Flush any pending user changes whenever we become connected,
|
||||
// including after a reconnect (not just the initial connection).
|
||||
handleUserChanges();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user