From f2c324524027d53f633cebb14c160b5545526abc Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Tue, 24 Mar 2026 13:21:59 -0700 Subject: [PATCH] fix: ensure demo community visibility is always public on startup The demo Automerge doc had visibility: "private" from initial creation. ensureDemoCommunity now forces visibility to "public" on every startup if it drifted. Co-Authored-By: Claude Opus 4.6 --- server/seed-demo.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/seed-demo.ts b/server/seed-demo.ts index e7f55f5..fc6a21f 100644 --- a/server/seed-demo.ts +++ b/server/seed-demo.ts @@ -14,6 +14,7 @@ import { getDocumentData, loadCommunity, markShapesSeeded, + updateSpaceMeta, } from "./community-store"; // ── Alpine Explorer 2026 — Demo Scenario ────────────────────────── @@ -780,6 +781,12 @@ export async function ensureDemoCommunity(): Promise { console.log("[Demo] Created demo community with visibility: public"); } else { await loadCommunity("demo"); + // Ensure visibility stays "public" (older docs may have been created as "private") + const doc = getDocumentData("demo"); + if (doc?.meta?.visibility !== "public") { + updateSpaceMeta("demo", { visibility: "public" }); + console.log("[Demo] Fixed demo visibility → public"); + } } // Check if already seeded (has shapes or was previously seeded then cleared)