Skip to content

Commit c865b18

Browse files
authored
fix: clear stale skip secret on install (#188)
1 parent 5fb91c4 commit c865b18

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

packages/sync-engine/src/supabase/supabase.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export class SupabaseSetupClient {
148148
-- Store unique worker secret in vault for pg_cron to use
149149
-- Delete existing secret if it exists, then create new one
150150
DELETE FROM vault.secrets WHERE name = 'stripe_sync_worker_secret';
151+
DELETE FROM vault.secrets WHERE name = 'stripe_sync_skip_until';
151152
SELECT vault.create_secret('${escapedWorkerSecret}', 'stripe_sync_worker_secret');
152153
153154
-- Delete existing jobs if they exist

packages/sync-engine/src/tests/unit/supabase.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ describe('SupabaseDeployClient', () => {
157157
// Get the SQL that was executed (runAQuery(projectRef, { query }))
158158
const executedSQL = (mockRunQuery.mock.calls[0][1] as { query: string }).query
159159

160+
expect(executedSQL).toContain(
161+
"DELETE FROM vault.secrets WHERE name = 'stripe_sync_skip_until';"
162+
)
163+
160164
// Verify it contains the custom base URL
161165
expect(executedSQL).toContain(
162166
`https://${mockProjectRef}.test-domain.com/functions/v1/stripe-worker`

0 commit comments

Comments
 (0)