Draft
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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{}inParseHTTPResponseevent.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 change
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).
Test plan
go build ./...go test ./internal/destregistry/...go test ./internal/apirouter/...go test ./internal/logstore/...🤖 Generated with Claude Code