You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor(forms-api): make spam-protection policy declarative per form
Extract the spam-protection pipeline (recaptcha + honeypot + gibberish +
timing) into a single declarative SpamPolicy passed to runSpamChecks, and
extract the email-then-persist sequence (with emailSent/warning fallback)
into sendAndPersist. Contact form gets the full policy; doula-match form
gets recaptcha-only, matching observed spam volume.
Records the reactive-per-form decision in ADR-0001 so future reviews do
not "fix" the asymmetry by unifying the two policies.
HTTP contract preserved; all 25 route tests pass unchanged.
* refactor(forms-api): harden sendAndPersist and spam policy logging
- Wrap persist() in try/catch; log CRITICAL with emailSent+persistFailed
when email succeeded but Firestore persist failed, then re-throw
- Tighten SendAndPersistResult to a discriminated union and document
the persist callback's idempotency contract
- Use static log message prefixes in run-spam-checks (formType moved
to structured metadata) and emit debug logs when honeypot/gibberish/
timing policy sections are not configured
- Add route-level test exercising multi-field gibberish flagging
* chore(functions): remove unnecessary type assertions
Auto-fix from eslint --fix to clear pre-existing
@typescript-eslint/no-unnecessary-type-assertion errors that were
failing CI.
0 commit comments