diff --git a/modules/rcal/mod.ts b/modules/rcal/mod.ts index 4ca653d..25e9647 100644 --- a/modules/rcal/mod.ts +++ b/modules/rcal/mod.ts @@ -275,7 +275,10 @@ function seedDemoIfEmpty(space: string) { if (d.meta) (d.meta as any).seeded = true; }); - console.log("[Cal] Demo data seeded: 2 sources, 7 events"); + // Verify tags survived Automerge change + const verifyDoc = _syncServer!.getDoc(docId); + const firstEv = verifyDoc ? Object.values(verifyDoc.events)[0] : null; + console.log(`[Cal] Demo data seeded: 2 sources, 7 events — tags: ${JSON.stringify(firstEv?.tags)}, has_key: ${'tags' in (firstEv || {})}`); } // ── API: Events ── diff --git a/server/local-first/doc-persistence.ts b/server/local-first/doc-persistence.ts index 3cdd13a..6e9b350 100644 --- a/server/local-first/doc-persistence.ts +++ b/server/local-first/doc-persistence.ts @@ -186,6 +186,14 @@ async function scanDir(dir: string, syncServer: SyncServer): Promise { const doc = Automerge.load(bytes); const docId = pathToDocId(fullPath); + // Debug: check cal doc tags during load + if (docId.includes(':cal:events')) { + const events = (doc as any).events; + if (events) { + const first = Object.values(events)[0] as any; + console.log(`[DocStore] Loading ${docId}: tags=${JSON.stringify(first?.tags)}, has_tags=${'tags' in (first || {})}, keys=${Object.keys(first || {}).filter((k: string) => k.startsWith('t'))}`); + } + } syncServer.setDoc(docId, doc); count++; } catch (e) {