Improve document revision creation (#5474)

This commit is contained in:
Tom Moor
2023-06-25 08:29:24 -04:00
committed by GitHub
parent 86d6117a31
commit 7940cef517
6 changed files with 42 additions and 27 deletions

View File

@@ -82,6 +82,7 @@ export default class PersistenceExtension implements Extension {
document,
context,
documentName,
clientsCount,
}: onStoreDocumentPayload) {
const [, documentId] = documentName.split(".");
@@ -105,6 +106,7 @@ export default class PersistenceExtension implements Extension {
// TODO: Right now we're attributing all changes to the last editor,
// It would be nice in the future to have multiple editors per revision.
userId: collaboratorIds.pop(),
isLastConnection: clientsCount === 0,
});
} catch (err) {
Logger.error("Unable to persist document", err, {