Skip to content

Commit a995731

Browse files
committed
fix(track-changes): match fallback in mark lookup to prevent per-keystroke splitting
The `|| ''` fallbacks added to mark creation caused a mismatch with findTrackedMarkBetween lookups that still passed raw `user.email` (undefined when no user is set). `'' === undefined` fails, so each keystroke generated a new tracked-change ID instead of reusing the adjacent mark's ID.
1 parent 965af10 commit a995731

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/super-editor/src/editors/v1/extensions/track-changes/trackChangesHelpers/markDeletion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const markDeletion = ({ tr, from, to, user, date, id: providedId }) => {
2929
from,
3030
to,
3131
markName: TrackDeleteMarkName,
32-
attrs: { authorEmail: user.email },
32+
attrs: { authorEmail: user.email || '' },
3333
});
3434

3535
let id;

packages/super-editor/src/editors/v1/extensions/track-changes/trackChangesHelpers/markInsertion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const markInsertion = ({ tr, from, to, user, date, id: providedId }) => {
2121
from,
2222
to,
2323
markName: TrackInsertMarkName,
24-
attrs: { authorEmail: user.email },
24+
attrs: { authorEmail: user.email || '' },
2525
});
2626

2727
let id;

0 commit comments

Comments
 (0)