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(webhooks): unify webhook errors under InvalidWebhookError (CHA-3071)
Per cross-SDK coordination (mogita's review on the 6 sibling SDK PRs),
every webhook failure path now terminates at a single exception class.
Customers only need one except arm and can filter by message text for
mode-specific behaviour (signature mismatch vs invalid base64 etc.).
Renames the previously-unreleased WebhookSignatureError to
InvalidWebhookError and threads it through every primitive:
verify_signature -> 'signature mismatch'
gunzip_payload -> 'gzip decompression failed'
decode_sqs_payload -> 'invalid base64 encoding'
parse_event -> 'invalid JSON payload'
StreamChat#verify_webhook (the legacy bool helper) is untouched. The
message constants are exported so callers can exact-match if they
prefer that over substring matching.
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: docs/webhooks/webhooks_overview/webhooks_overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,7 @@ def stream_webhook():
135
135
136
136
The same call works whether or not Stream is compressing for this app, and whether or not your framework auto-decompressed the request — the helper inspects the body bytes rather than the `Content-Encoding` header.
137
137
138
-
All helpers raise `stream_chat.base.exceptions.WebhookSignatureError` when the signature does not match, when the gzip stream is corrupt, or when the SQS/SNS base64 envelope cannot be decoded.
138
+
All helpers raise `stream_chat.webhook.InvalidWebhookError` when the signature does not match, when the gzip stream is corrupt, or when the SQS/SNS base64 envelope cannot be decoded.
139
139
140
140
The original `client.verify_webhook(request.body, request.headers["X-Signature"])` — which returns a `bool` and does not decompress — stays unchanged for backward compatibility. Switch to `verify_and_parse_webhook` to support compressed payloads.
0 commit comments