Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

Fix create transaction sync in sync

Hakan Shehucde22dec3d64
diff --git a/apps/server/src/services/entry-service.ts b/apps/server/src/services/entry-service.ts
index f8cf8bb7..2a497dc9 100644
--- a/apps/server/src/services/entry-service.ts
+++ b/apps/server/src/services/entry-service.ts
@@ -301,10 +301,6 @@ class EntryService {
input: ApplyCreateTransactionInput
): Promise<ApplyCreateTransactionOutput | null> {
const root = await fetchEntry(input.rootId);
- if (!root) {
- return null;
- }
-
const ydoc = new YDoc();
ydoc.applyUpdate(input.data);
const attributes = ydoc.getAttributes<EntryAttributes>();
@@ -316,7 +312,7 @@ class EntryService {
userId: user.id,
role: user.role,
},
- root: mapEntry(root),
+ root: root ? mapEntry(root) : null,
},
attributes
)