docs(webhooks): only document content arms providers actually emit inbound#71
Conversation
|
Warning Review limit reached
More reviews will be available in 9 minutes and 54 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughUpdated webhook event documentation: reactions and similar arms arrive inside the single ChangesWebhook Event Specification and Handler Guide
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Actionable comments posted: 0 |
ea0d7ed to
3bc37a9
Compare
|
Actionable comments posted: 0 |
3bc37a9 to
224bd75
Compare
|
Actionable comments posted: 0 |
224bd75 to
69ef005
Compare
|
Actionable comments posted: 0 |
69ef005 to
9da46f4
Compare
4caa479 to
b19b9f2
Compare
b19b9f2 to
82ced5d
Compare
Webhooks are inbound-only; providers deliver a subset of the SDK's Content union (spectrum-ts/content documents the full send-side union). Delivered inbound: text, attachment, reaction, contact, richlink, group. Confirmed against live iMessage deliveries and spectrum-ts main inbound parsers. Not delivered inbound (covered by a short note + the spectrum-ts/content link, not enumerated): reply (arrives as text), voice (arrives as attachment), edit / typing (send-only), poll / poll_option (the SDK's inbound parsers construct poll_option, but inbound polls aren't a supported feature), custom (WhatsApp-only, untested; these docs are iMessage-focused). Also corrects message.id (composite for derived events, e.g. reactions), space.phone (shared for pooled lines), and adds reaction + album examples. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
82ced5d to
a23f617
Compare
Why
Goal: the webhook docs should only claim what's verifiably true. A few statements promised behavior that no shipping provider produces.
Overclaim: inbound
reply/edit/typing/voice/effectThe events spec said "reactions, typing, edits, and replies arrive inside the
messagespayload ascontent.typearms." Traced through the actual inbound parsers inspectrum-ts:providers/imessage/remote/stream.ts+inbound.ts): onlymessage.received→text/attachment/group/richlink/contact/custom,message.reactionAdded→reaction, and poll votes →poll_option. Everything else yields empty values. Inbound replies are flattened totext—reply_target_guid/thread_originator_guidare present on the gRPC message but never read, so the thread link never reaches the wire.providers/whatsapp-business/messages.tsmapContent):text, media →attachment,reaction, interactive →poll_option, contacts →contact, everything else →custom. Noreply/edit/typing.So
reply/edit/voice/effect/typingare send-only or simply not emitted inbound today, and a standalonepollarm is never emitted (poll context rides inline onpoll_option). Meanwhilepoll_option(which is emitted, and shows up in prod logs) was missing from the table.The per-arm reference is now split into "delivered inbound today" vs "tolerated but not emitted inbound" so the page stops promising arms that never arrive.
Broken reference:
app.spaces.get(spaceId)The quickstart reply example called
app.spaces.get(spaceId). The Spectrum instance has nospaces(nor any get-space-by-id API) — the runtime object only exposesmessages/send/edit/stop/responding. Replaced with the real, documented path: rebuild the DM from the sender viaimessage(app).space(await im.user(sender.id)), and passmessage.sender.idfrom the webhook. The events "what you don't get" notes were updated to match.Files
docs-src/webhooks/events.mdx.vel(source;webhooks/events.mdxis a gitignored build artifact, regenerated viavellum build)webhooks/overview.mdx,webhooks/delivery.mdx,webhooks/quickstart.mdx(hand-written)Verification
vellum build+eslint+typecheck:docsall pass (pre-commit hook).spectrum-tsinbound parsers andspectrum-webhook/src/delivery/serialize.ts.Test plan
webhooks/events— delivered vs not-delivered tables read correctlyspectrum-tsMade with Cursor
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit