Skip to content

feat(router): report delivery payload for 296 delivered-with-warning - #7226

Closed
ItsSudip wants to merge 5 commits into
masterfrom
feature/int-6637-rudder-server-add-delivery-payload-for-success-scenario-in
Closed

ItsSudip wants to merge 5 commits into
masterfrom
feature/int-6637-rudder-server-add-delivery-payload-for-success-scenario-in

Conversation

@ItsSudip

Copy link
Copy Markdown
Member

🔒 Scanned for secrets using gitleaks 8.28.0

Description

On the router's success path, postStatusOnResponseQ reported the router input payload (JobT.EventPayload) to reporting for every status code — the success branch hardcoded payload: inputPayload, so the transformed body actually sent to the destination was never available to reporting.

For the 296 "Delivered with Warning" outcome, the Events tab needs to show what was actually delivered, not the input event. This PR reports destinationJob.Message for 296 only.

Changes

  • utils/types: add DeliveredWithWarningCode = 296 alongside the existing FilterEventCode / SuppressEventCode constants, so the status code isn't a magic number.
  • router/worker.go: in the success branch of postStatusOnResponseQ, report destinationJob.Message instead of the input payload when the status is 296, and set payloadStage=delivery on the status so reporting can tell the sample is the delivery body rather than the input event. Non-296 success responses are unchanged (no payloadStage marker — noted in a comment).
  • router/handle.go, router/handle_lifecycle.go: add storeDeliveredWithWarningPayload, a reloadable per-destType bool (default false, opt-in) mirroring the existing reportJobsdbPayload. Turning it on enables delivery-payload reporting for 296; turning it off reverts it without affecting the warning status or the destination's response body.

Scope

The behaviour change is strictly limited to respStatusCode == 296. 200, the filter code (298), and the failure path are unchanged.

Testing

TestPostStatusOnResponseQStoreDeliveredWithWarningPayload covers: 296 → delivery body + payloadStage=delivery; 200 → input payload with no marker; 296 with the flag off → input payload; filter code → still Filtered with the input payload. go build ./..., go vet, and the full TestRouter suite pass.

Linear Ticket

https://linear.app/rudderstack/issue/INT-6637/rudder-server-add-delivery-payload-for-success-scenario-in-reporting

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

ItsSudip added 5 commits July 24, 2026 13:27
On the success path the router reported the router input payload for every
status code, so the transformed body actually sent to the destination was
never available to reporting. The Events tab needs that body for 296
(Delivered with Warning) to show what was really delivered.

Report destinationJob.Message instead of the input payload when the status
is 296, and mark the status with payloadStage=delivery so reporting can
tell the sample is the delivery body rather than the input event.

Scoped strictly to 296 and gated by store296DeliveryPayload, a reloadable
per-destType kill-switch (default on) that reverts payload storage without
disabling the warnings feature. All other status codes are unchanged.

INT-6637

Co-Authored-By: Claude Opus 4.8 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
- rename store296DeliveryPayload -> storeDeliveredWithWarningPayload
  (field, config key, and test) so the flag reads by intent, not status code
- default the flag to false: delivery-payload reporting is opt-in per destType
- rename success-branch local successPayload -> responsePayload
- drop the empty-delivery-body test case: a 296 always carries a delivered
  body, so the removed assertion could never fail

INT-6637

Co-Authored-By: Claude Opus 4.8 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
- rename success-branch local responsePayload -> payload
- note why non-296 success responses omit a payloadStage marker

INT-6637

Co-Authored-By: Claude Opus 4.8 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
…y-payload-for-success-scenario-in

Resolve conflicts from INT-6636 (PR #7217) landing in master:
- utils/types: single DeliveredWithWarningCode constant (both PRs added it)
- router/handle.go: keep both storeDeliveredWithWarningPayload (this PR) and
  supportsDeliveredWithWarnings (INT-6636)
- router/worker_test.go: keep both PRs' test functions

Co-Authored-By: Claude Opus 4.8 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
…ture/int-6637-rudder-server-add-delivery-payload-for-success-scenario-in

🔒 Scanned for secrets using gitleaks 8.28.0
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.74%. Comparing base (3e126b2) to head (20efe55).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7226      +/-   ##
==========================================
- Coverage   79.78%   79.74%   -0.04%     
==========================================
  Files         599      599              
  Lines       66862    66862              
==========================================
- Hits        53343    53319      -24     
- Misses      10380    10409      +29     
+ Partials     3139     3134       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ItsSudip

Copy link
Copy Markdown
Member Author

Superseded — the INT-6637 changes already landed in master via #7217's squash-merge (1d772a1), so this PR has no remaining diff to merge. Closing.

@ItsSudip ItsSudip closed this Jul 30, 2026
@ItsSudip
ItsSudip deleted the feature/int-6637-rudder-server-add-delivery-payload-for-success-scenario-in branch July 30, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant