fix(dataexchange): omit raw data field when IncludeBase64 is true (PILOT-269)#9
fix(dataexchange): omit raw data field when IncludeBase64 is true (PILOT-269)#9matthew-pilot wants to merge 2 commits into
Conversation
…-269) The existing test only checked data_b64 presence but never verified that data was absent when IncludeBase64 is enabled — which is the 2× payload blowup described in the ticket. This commit will FAIL until the fix in service.go is applied.
…LOT-269) When IncludeBase64=true, saveInboxMessage stored both the raw string(frame.Payload) as 'data' AND its base64 encoding as 'data_b64', effectively doubling the JSON payload size. For a max 256MiB frame, this produced ~683MiB of JSON (256MiB raw + 341MiB base64 + overhead). Fix: omit 'data' when 'data_b64' is present — IncludeBase64 operators get the lossless base64 representation without the duplicate. Closes PILOT-269
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🦾 Matthew PR Check — #9 PILOT-269Status
SummaryNarrow fix to 🤖 matthew-pr-worker · 2026-05-30T01:09 UTC |
🦾 Matthew Explains — #9 PILOT-269What this doesRestructures the inbox message JSON payload so that when WhyPreviously, the raw What changed
RiskMinimal — this is a response format change in a single function ( Scope
|
What failed
When
IncludeBase64=true,saveInboxMessagestored both the rawstring(frame.Payload)asdataAND its base64 encoding asdata_b64, doubling the JSON payload size. For a max 256MiB frame, this produced ~683MiB of JSON per message.Root cause
service.go:263-272: Thedatafield was unconditionally added to the message map, anddata_b64was then appended on top whenIncludeBase64was enabled.Fix
Move
datainto theelsebranch — whenIncludeBase64=true, onlydata_b64is populated (canonical lossless representation). WhenIncludeBase64=false, onlydatais populated (same as before).Files changed
service.go: +2/-1zz_more_test.go: +20/-6 (tightened assertions: data absent when b64, data_b64 absent when raw)Verification
Closes PILOT-269