fix: TypeError when document.collaboratorIds is null (#12471)

Guard against null collaboratorIds when persisting collaborative
updates; the DB column has no default and can be NULL on older rows.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Tom Moor
2026-05-26 19:56:56 -04:00
committed by GitHub
parent 8989287e8a
commit 03950af3b7
@@ -71,7 +71,7 @@ export default async function documentCollaborativeUpdater({
const pud = new Y.PermanentUserData(ydoc);
const pudIds = Array.from(pud.clients.values());
const collaboratorIds = uniq([
...document.collaboratorIds,
...(document.collaboratorIds ?? []),
...sessionCollaboratorIds,
...pudIds,
]);