mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 18:06:15 -04:00
Pad: Don't create no-op revisions
This commit is contained in:
parent
56b7671422
commit
a370cfa5c6
6 changed files with 18 additions and 12 deletions
|
@ -207,8 +207,10 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
|||
});
|
||||
} else if (msg.type === 'ACCEPT_COMMIT') {
|
||||
serverMessageTaskQueue.enqueue(() => {
|
||||
const newRev = msg.newRev;
|
||||
if (newRev !== (rev + 1)) {
|
||||
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).
|
||||
if (![rev, rev + 1].includes(newRev)) {
|
||||
window.console.warn(`bad message revision on ACCEPT_COMMIT: ${newRev} not ${rev + 1}`);
|
||||
// setChannelState("DISCONNECTED", "badmessage_acceptcommit");
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue