From ad75781efdb550a4bb86a127cfc7735b0c6cd5c6 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Wed, 25 Mar 2026 18:08:51 -0700 Subject: [PATCH] fix(spaces): set clf and bcrg to permissioned on startup One-shot migration to fix visibility for spaces that were changed by stale client sync. Also imports updateSpaceMeta in index.ts. Co-Authored-By: Claude Opus 4.6 --- server/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server/index.ts b/server/index.ts index b0451e7..9025233 100644 --- a/server/index.ts +++ b/server/index.ts @@ -28,6 +28,7 @@ import { cascadePermissions, listCommunities, deleteCommunity, + updateSpaceMeta, } from "./community-store"; import type { NestPermissions, SpaceRefFilter } from "./community-store"; import { ensureDemoCommunity } from "./seed-demo"; @@ -3696,7 +3697,7 @@ loadAllDocs(syncServer) }) .catch((e) => console.error("[DocStore] Startup load failed:", e)); -// Restore relay mode for encrypted spaces +// Restore relay mode for encrypted spaces + one-shot visibility fixes (async () => { try { const slugs = await listCommunities(); @@ -3712,6 +3713,16 @@ loadAllDocs(syncServer) if (relayCount > 0) { console.log(`[Encryption] ${relayCount} space(s) set to relay mode (encrypted)`); } + + // One-shot: fix spaces that should be permissioned + const fixPermissioned = ["clf", "bcrg"]; + for (const slug of fixPermissioned) { + const data = getDocumentData(slug); + if (data && data.meta?.visibility !== "permissioned") { + updateSpaceMeta(slug, { visibility: "permissioned" }); + console.log(`[VisFix] Set ${slug} to permissioned (was: ${data.meta?.visibility})`); + } + } } catch (e) { console.error("[Encryption] Failed to restore relay modes:", e); }