Skip to content

fix(integrations): Store webhook request bodies without double encoding - #122361

Open
mrduncan wants to merge 1 commit into
masterfrom
mrduncan/fix-webhook-buffer-body-encoding
Open

fix(integrations): Store webhook request bodies without double encoding#122361
mrduncan wants to merge 1 commit into
masterfrom
mrduncan/fix-webhook-buffer-body-encoding

Conversation

@mrduncan

@mrduncan mrduncan commented Aug 20, 2026

Copy link
Copy Markdown
Member

Failure bodies in the Sentry App request buffer were passed through json.dumps even though they were already serialized strings, so the API returned double-encoded JSON that clients had to unwrap.

Truncation also ran after encoding and sliced response.content as raw bytes, which cut a multi-byte sequence when a non-JSON body crossed the 1024 limit and raised UnicodeDecodeError when the entry was written to Redis. Bodies are now decoded first and truncated by character.

The badly encoded versions will age out 30 days after this is deployed.

See also: #121577

Failure bodies in the Sentry App request buffer were passed through json.dumps even though they were already serialized strings, so the API returned double-encoded JSON that clients had to unwrap.

Truncation also ran after encoding and sliced response.content as raw bytes, which cut a multi-byte sequence when a non-JSON body crossed the 1024 limit and raised UnicodeDecodeError when the entry was written to Redis. Bodies are now decoded first and truncated by character.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 20, 2026
@mrduncan
mrduncan marked this pull request as ready for review August 20, 2026 18:52
@mrduncan
mrduncan requested review from a team as code owners August 20, 2026 18:52
@mrduncan
mrduncan requested a review from a team August 21, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant