fix: Do not update lastModifiedById on deleted documents (edit history still stored in revisions) (#10302)

This commit is contained in:
Tom Moor authored and GitHub committed 2025-10-05 16:08:13 -04:00
1 parent 398943d084
commit 10c3edded7
1 file changed
+5 -3
@@ -44,9 +44,11 @@ export default async function documentCollaborativeUpdater({
const state = Y.encodeStateAsUpdate(ydoc);
const content = yDocToProsemirrorJSON(ydoc, "default") as ProsemirrorData;
const isUnchanged = isEqual(document.content, content);
const lastModifiedById =
sessionCollaboratorIds[sessionCollaboratorIds.length - 1] ??
document.lastModifiedById;
const isDeleted = !!document.deletedAt;
const lastModifiedById = isDeleted
? document.lastModifiedById
: (sessionCollaboratorIds[sessionCollaboratorIds.length - 1] ??
document.lastModifiedById);
if (isUnchanged) {
return;