Fix patch text mismatch logging

Was comparing the old Server text to new Client text, instead of comparing *patched* server to client. This should give a better idea of what characters are not matching.
This commit is contained in:
Trevor Buckner
2026-10-21 17:06:06 -04:00
committed by GitHub
parent 0346f32c64
commit 9e7eef14e3
+3 -2
View File
@@ -375,12 +375,13 @@ const api = {
if(failedPatchCount){
throw (`Patch failure: ${failedPatchCount}/${result[1].length} did not apply`);
}
if(decodeURI(result[0]) != brewFromClient.text){
patchedText = decodeURI(result[0]);
if(patchedText != brewFromClient.text){
debugTextMismatch(brewFromClient.text, patchedText, `edit/${brewFromClient.editId}`);
throw ('Patches did not apply cleanly, text mismatch detected');
}
// brew.text = applyPatches(patches, brewFromServer.text)[0];
} catch (err) {
debugTextMismatch(brewFromClient.text, brewFromServer.text, `edit/${brewFromClient.editId}`);
console.error('Failed to apply patches:', {
// patches : brewFromClient.patches,
// result : result,