PadMessageHandler: Accept retransmissions of USER_CHANGES

This commit is contained in:
Richard Hansen 2021-12-12 18:19:36 -05:00
parent a370cfa5c6
commit cff089e54e
3 changed files with 10 additions and 13 deletions

View file

@ -208,8 +208,9 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
} else if (msg.type === 'ACCEPT_COMMIT') {
serverMessageTaskQueue.enqueue(() => {
const {newRev} = msg;
// newRev will equal rev if the changeset has no net effect (identity changeset, or removing
// and re-adding the same characters with the same attributes).
// newRev will equal rev if the changeset has no net effect (identity changeset, removing
// and re-adding the same characters with the same attributes, or retransmission of an
// already applied changeset).
if (![rev, rev + 1].includes(newRev)) {
window.console.warn(`bad message revision on ACCEPT_COMMIT: ${newRev} not ${rev + 1}`);
// setChannelState("DISCONNECTED", "badmessage_acceptcommit");