fix: 'undefined' changed document log (#10695)

This commit is contained in:
Tom Moor
2025-11-23 14:36:58 +01:00
committed by GitHub
parent 8619ef2bea
commit 2abc1e97ae
+5 -5
View File
@@ -78,12 +78,12 @@ export default class PersistenceExtension implements Extension {
async onChange({ context, documentName }: withContext<onChangePayload>) {
const [, documentId] = documentName.split(".");
Logger.debug(
"multiplayer",
`${context.user?.name} changed ${documentName}`
);
if (context.user) {
Logger.debug(
"multiplayer",
`${context.user.name} changed ${documentName}`
);
const key = Document.getCollaboratorKey(documentId);
await Redis.defaultClient.sadd(key, context.user.id);
}