Repository navigation
feat(demo): auto-confirm demo bookings that came through the verified form and decline the rest - #9976
Conversation
… form and decline the rest
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge, with no new actionable issues found. SummaryAdds automatic review of demo bookings using the form’s Turnstile result.
The previous findings are addressed or retracted. waleedlatif1 declined the external-fetch annotation because the rule does not cover this server-side external call; Greptile accepted that explanation and retracted the finding. All supplied previous threads were unnumbered, so none appear in
|
…eep webhook decisions stable
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
/api/demo-requestsgains the same honeypot and Turnstile handling as/api/contact. It records the outcome per email in Redis, keyed by a SHA-256 hash, for 24h, consumed by the first booking that claims it./api/demo-requests/bookingswebhook verifiesx-cal-signature-256(HMAC-SHA256 of the raw body) before acting. It calls Cal.com's confirm/decline API with one retry on network or 5xx errors.after(). The scheduler and its preload are unchanged. A failed record write answers 503 and the form shows an inline error./teamand the upgrade page's sales button now go to/demoinstead of the raw Cal.com link, so every booking path passes the form.CAL_API_KEYandCAL_WEBHOOK_SECRET. With either unset, the webhook is off or leaves every request pending, so nothing is auto-declined.Type of Change
Testing
BOOKING_REQUESTEDon the demo event. Then book once through/demo(confirmed) and once through the raw Cal.com link (declined).Checklist
test-auditauthoring gate)🤖 Generated with Claude Code