Repository navigation
Drop build-time tenant baking from the Pro daemon plist (ADR-053 per-database cloud sync, S2 core) - #1605
Conversation
The Pro edition previously baked the tenant (schema + collection) into the launchd plist at build time via the NODESPACE_PRO_SCHEMA / NODESPACE_PRO_COLLECTION option_env constants. The tenant a database syncs to is now bound per database at runtime (ADR-053 per-database cloud sync), so only the deployment-wide Supabase endpoint — project URL + publishable anon key — stays build-time. Remove the PRO_SCHEMA / PRO_COLLECTION constants and the NODESPACED_PRO_SCHEMA / NODESPACED_PRO_COLLECTION keys from the Pro EnvironmentVariables block the app writes into the launchd plist. Inert for the community build, which never received these keys. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
APPROVE — the diff is correct and community-inert. Two deploy-order flags on the epic (the code is fine; these are about when things can ship together). Verified
|
Summary
S2 (core half) of ADR-053 per-database cloud sync (#1535): stop baking the tenant (schema + collection) into the Pro daemon's launchd plist at build time. Only the deployment-wide Supabase endpoint — project URL + publishable anon key — stays build-time; the tenant a database syncs to is bound per database at runtime and is no longer an install-time constant.
PRO_SCHEMA/PRO_COLLECTIONoption_env!constants (NODESPACE_PRO_SCHEMA/NODESPACE_PRO_COLLECTIONbuild-time env).NODESPACED_PRO_SCHEMA/NODESPACED_PRO_COLLECTIONkeys from the ProEnvironmentVariablesblock the app writes into~/Library/LaunchAgents.NODESPACED_PRO_SUPABASE_URL+NODESPACED_PRO_ANON_KEYremain (deployment-wide, not tenant-specific).The tenant model for this epic is a Postgres schema in one shared Supabase project, so the URL + anon key are legitimately deployment-wide and correct to keep build-time; only schema/collection are per-tenant. With this change a Pro install no longer carries a single baked tenant — the daemon takes its tenant from its runtime configuration (the per-database bound tenant added in S1, wired into the daemon's session path in a later slice).
Community safety
Fully inert for the community build: these env keys were only ever emitted when
is_pro_build()(i.e. a Pro build withNODESPACE_PRO_SUPABASE_URLbaked in). The communitynodespaceddaemon never received them. No behavior change to the community edition.Tests
cargo fmt -p nodespace-app -- --checkclean;cargo clippy -p nodespace-app --all-targets -- -D warningsclean;cargo test -p nodespace-appgreen (no test asserts on the plist tenant keys — the plist writer has no snapshot coverage, and no other code referencedPRO_SCHEMA/PRO_COLLECTION).daemon_setup.rs— no core-lib, frontend, or e2e surface touched.The matching sync-repo change (remove the
.pkgplist template placeholders + thebuild-pro-pkg.sh/build-pro-dmg.shtenant substitutions) lands as a follow-up PR in nodespace-sync and must merge after this one, so a Pro build never emits an empty schema.Part of #1535 (S2 of the S1–S8 decomposition on the issue).