Closed
Description
Repro: https://codesandbox.io/p/devbox/x5s3pc
/** Combine a set of revisions in to their full text */
export async function textOfRevisions(_revisions: Revision[]) {
const revisions = assertZeroRevision(_revisions);
return revisions.reduce((acc, r, index) => {
if (r.sequence === 0) return r.text;
const thisText = diff7.applyPatch(acc, r.text); // VERSION 7 FAILS TO APPLY
// const thisText = diff5.applyPatch(acc, r.text);
if (thisText === false) throw new Error(`Failed to apply patch ${index}`);
if (!md5Match(thisText, r.checksum)) {
throw new Error(`Checksum mismatch on revision ${index}`);
}
return thisText;
}, "");
}
I'm storing a full original text document and patches for updates to that document.
After updating diff
to version 7, the patches I had stored could not be applied.
diff.applyPatch(<originalText>, <patch>);
would return false.
Is this expected as part of a breaking change? I don't see any mention of breaking changes or migration needed.
Metadata
Metadata
Assignees
Labels
No labels