fix: store HTTP response body as raw string#723
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Previously, ParseHTTPResponse would unmarshal JSON response bodies into
map[string]interface{}, losing original key ordering. Now the body is
always stored as a raw string regardless of content type, consistent
with how event data preserves payload integrity.
Breaking change: response_data.body is now always a string, even when
the destination returns application/json.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
750b4cb to
9fc7bb1
Compare
Completes the raw-string storage approach started in #714/#718. The response_data column was the last JSONB column storing delivery data — convert it to TEXT so serialization is handled in application code, consistent with events.data and attempts.event_data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
alexbouchardd
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
map[string]interface{}inParseHTTPResponseattempts.response_datacolumn from JSONB to TEXT (migration000009)event.Data(raw bytes, no parsing) after feat: change Event.Data to json.RawMessage to preserve JSON key order #714 / fix: migrate PG event data columns from JSONB to TEXT #718Context
After #714 switched
Event.Datatojson.RawMessageand #718 migrated PG columns from JSONB to TEXT, response data is the remaining place where we parse and restructure data rather than preserving it verbatim.Currently, when a destination returns a JSON response, we unmarshal the body into a Go map. This:
This change stores the body as-is, matching our approach for event data integrity.
Breaking changes
API:
response_data.bodyis now always a string, even when the destination returnsapplication/json.Before — JSON response body was a parsed object:
{ "status": 200, "body": { "id": "usr_123", "status": "created", "metadata": { "source": "api" } } }After — body is the raw response string:
{ "status": 200, "body": "{\"id\":\"usr_123\",\"status\":\"created\",\"metadata\":{\"source\":\"api\"}}" }Non-JSON responses are unchanged (already stored as strings).
Database:
attempts.response_datacolumn is migrated from JSONB to TEXT (migration000009). Serialization is now handled in application code, consistent withevents.dataandattempts.event_data.🤖 Generated with Claude Code