feat: add no-show status to zapier integration#29244
feat: add no-show status to zapier integration#29244alchemistlethal-a11y wants to merge 1 commit intocalcom:mainfrom
Conversation
|
Welcome to Cal.diy, @alchemistlethal-a11y! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
📝 WalkthroughWalkthroughThe changes add specialized handling for no-show events in Zapier webhook payload generation within the 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/features/webhooks/lib/sendPayload.ts (1)
236-252:⚠️ Potential issue | 🟠 Major | ⚡ Quick winForce JSON content-type for the raw Zapier payload path.
The new no-show branch bypasses
applyTemplate, butcontentTypeis still decided before this special case. If a Zapier webhook has a non-JSON template, this path will send a JSON body withapplication/x-www-form-urlencoded, which can break the receiver.Suggested fix
- const contentType = - !template || jsonParse(template) ? "application/json" : "application/x-www-form-urlencoded"; + let contentType = + !template || jsonParse(template) ? "application/json" : "application/x-www-form-urlencoded"; @@ if (isEventPayload(data)) { data.description = data.description || data.additionalNotes; if (appId === "zapier") { body = getZapierPayload({ ...data, createdAt }); + contentType = "application/json"; } } else if (isNoShowPayload(data)) { if (appId === "zapier") { body = getZapierNoShowPayload({ ...data, createdAt }); + contentType = "application/json"; } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/features/webhooks/lib/sendPayload.ts` around lines 236 - 252, The contentType is decided before the special Zapier raw payload branches which can produce JSON bodies but leave contentType as application/x-www-form-urlencoded; adjust the logic so that when you construct a Zapier body (inside the branches using getZapierPayload or getZapierNoShowPayload) you also set contentType = "application/json" (or move the contentType determination to after the template/body logic) — update the code paths around isEventPayload/isNoShowPayload and the appId === "zapier" checks to ensure contentType matches the actual body format produced by getZapierPayload and getZapierNoShowPayload.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/features/webhooks/lib/sendPayload.ts`:
- Around line 236-252: The contentType is decided before the special Zapier raw
payload branches which can produce JSON bodies but leave contentType as
application/x-www-form-urlencoded; adjust the logic so that when you construct a
Zapier body (inside the branches using getZapierPayload or
getZapierNoShowPayload) you also set contentType = "application/json" (or move
the contentType determination to after the template/body logic) — update the
code paths around isEventPayload/isNoShowPayload and the appId === "zapier"
checks to ensure contentType matches the actual body format produced by
getZapierPayload and getZapierNoShowPayload.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0dad9605-2bec-4996-b90a-2cc0bf76c927
📒 Files selected for processing (1)
packages/features/webhooks/lib/sendPayload.ts
|
we've closed the issue. |
closes #18992
/claim #18992