From e8a94ceeb007e6e734b312b61d362b75a3f82a04 Mon Sep 17 00:00:00 2001 From: Avery Felts Date: Mon, 23 Mar 2026 01:14:33 -0600 Subject: [PATCH 1/2] fix: wire marketplace reviews sync to production Worker endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Set DEFAULT_CONFIG.endpointUrl to the production Cloudflare Worker URL (reviews.signetai.sh) so new installs are pre-configured - Add X-Signet-Sync: 1 header to outbound sync requests — required by the Worker as a lightweight origin gate to filter non-Signet clients - sync remains opt-in (enabled: false default) until Nicholai deploys the Worker; TODO comment marks where to flip the default Co-Authored-By: Claude Sonnet 4.6 --- packages/daemon/src/routes/marketplace-reviews.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/daemon/src/routes/marketplace-reviews.ts b/packages/daemon/src/routes/marketplace-reviews.ts index 292eb8cc7..98169885b 100644 --- a/packages/daemon/src/routes/marketplace-reviews.ts +++ b/packages/daemon/src/routes/marketplace-reviews.ts @@ -27,9 +27,14 @@ interface ReviewsSyncConfig { readonly lastSyncError: string | null; } +// Production sync endpoint — set by Nicholai after deploying the Cloudflare Worker. +// Until then, users can override via PATCH /api/marketplace/reviews/config. +// TODO: replace placeholder with live Worker URL once deployed. +const REVIEWS_SYNC_URL = "https://reviews.signetai.sh/api/reviews/sync"; + const DEFAULT_CONFIG: ReviewsSyncConfig = { enabled: false, - endpointUrl: "", + endpointUrl: REVIEWS_SYNC_URL, lastSyncAt: null, lastSyncError: null, }; @@ -344,7 +349,7 @@ export function mountMarketplaceReviewsRoutes(app: Hono): void { try { const response = await fetch(config.endpointUrl, { method: "POST", - headers: { "Content-Type": "application/json" }, + headers: { "Content-Type": "application/json", "X-Signet-Sync": "1" }, body: JSON.stringify({ source: "signet-marketplace", type: "reviews-sync", From d26f68f454ffd81c4bc4778069c95b40b01f540a Mon Sep 17 00:00:00 2001 From: Avery Felts Date: Mon, 23 Mar 2026 01:18:22 -0600 Subject: [PATCH 2/2] fix: backfill REVIEWS_SYNC_URL for existing installs with empty endpointUrl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - readConfig() now falls back to REVIEWS_SYNC_URL when the on-disk config has an empty or missing endpointUrl, so existing installs pick up the production URL without a manual PATCH - Remove misleading TODO comment — the URL is already the live value Co-Authored-By: Claude Sonnet 4.6 --- packages/daemon/src/routes/marketplace-reviews.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/daemon/src/routes/marketplace-reviews.ts b/packages/daemon/src/routes/marketplace-reviews.ts index 98169885b..6956a877b 100644 --- a/packages/daemon/src/routes/marketplace-reviews.ts +++ b/packages/daemon/src/routes/marketplace-reviews.ts @@ -27,9 +27,7 @@ interface ReviewsSyncConfig { readonly lastSyncError: string | null; } -// Production sync endpoint — set by Nicholai after deploying the Cloudflare Worker. -// Until then, users can override via PATCH /api/marketplace/reviews/config. -// TODO: replace placeholder with live Worker URL once deployed. +// Production sync endpoint. Pre-configured so users only need to set enabled: true. const REVIEWS_SYNC_URL = "https://reviews.signetai.sh/api/reviews/sync"; const DEFAULT_CONFIG: ReviewsSyncConfig = { @@ -145,7 +143,7 @@ function readConfig(): ReviewsSyncConfig { if (!isRecord(raw)) return DEFAULT_CONFIG; return { enabled: raw.enabled === true, - endpointUrl: typeof raw.endpointUrl === "string" ? raw.endpointUrl : "", + endpointUrl: typeof raw.endpointUrl === "string" && raw.endpointUrl.length > 0 ? raw.endpointUrl : REVIEWS_SYNC_URL, lastSyncAt: typeof raw.lastSyncAt === "string" ? raw.lastSyncAt : null, lastSyncError: typeof raw.lastSyncError === "string" ? raw.lastSyncError : null, };