From b1a5a3d27ba0d2a57200aac4b0b8766826b7f408 Mon Sep 17 00:00:00 2001 From: Max Goodhart Date: Thu, 5 Nov 2020 00:58:09 -0800 Subject: [PATCH] Disable text diffing when calculating state deltas --- src/node/server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node/server.js b/src/node/server.js index 05cb178..a6e554e 100644 --- a/src/node/server.js +++ b/src/node/server.js @@ -19,6 +19,10 @@ export const SESSION_COOKIE_NAME = 's' const stateDiff = createJSONDiffPatch({ objectHash: (obj, idx) => obj._id || `$$index:${idx}`, + // Disable text diffing, both because it's overkill, and because it can crash with emojis (https://github.com/google/diff-match-patch/issues/68) + textDiff: { + minLength: Infinity, + }, }) function initApp({