From 9e7eef14e37bd99392542b77d27066fa6c6a7ddb Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 21 Oct 2026 17:06:06 -0400 Subject: [PATCH] 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. --- server/homebrew.api.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 2fd81e4f2..194dcd3fa 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -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,