Skip to content

fix(facilitator): parse boolean env vars strictly - #162

Merged
ds1 merged 1 commit into
masterfrom
fix/facilitator-env-booleans
Oct 30, 2026
Merged

ds1 merged 1 commit into
masterfrom
fix/facilitator-env-booleans

Conversation

@ds1

@ds1 ds1 commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Problem

apps/facilitator/src/config.ts parsed SUPABASE_SMTP_CONFIGURED and OFAC_ENABLED with z.coerce.boolean(), which turns any non-empty string into true. Setting either to "false" (as .env.example shows) enabled it:

Fix

A strict envBoolean schema: accepts true/false/1/0 (and upper-case TRUE/FALSE), defaults to false when unset, and fails startup with a named error for anything else (e.g. yes).

Tests

  • New src/__tests__/config.test.ts (8 tests): each accepted value for both flags, unset defaults to false, unrecognized value throws.
  • Facilitator typecheck clean. Full facilitator suite: 74 passed; one unrelated intermittent failure in shutdown-load.test.ts that passed 3/3 with and without this change (filed as Flaky test: shutdown-load concurrent requests under full suite #161).

Deploy note

Merging this deploys the facilitator from latest master (it changes a file under the service's apps/facilitator/** watch path). Production currently leaves both flags unset, so behavior is unchanged until SUPABASE_SMTP_CONFIGURED=true is set after Resend SMTP is configured.

Relates to #128.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NbrZHvYoDo9HCJXRGkVjCF

z.coerce.boolean() treats any non-empty string as true, so
SUPABASE_SMTP_CONFIGURED=false and OFAC_ENABLED=false enabled both.
Accept only true/false/1/0 and reject anything else at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NbrZHvYoDo9HCJXRGkVjCF
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pincerpay-agent-demo Ready Ready Preview Oct 30, 2026 4:30am UTC
pincerpay-dashboard Ready Ready Preview Oct 30, 2026 4:30am UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – pincerpay-agent-demo — a18cd478 Deployed Oct 30, 2026 by vercel[bot]
Preview – pincerpay-dashboard — a18cd478 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant