Skip to content

feat: add OriginalID and OriginalDestinationID to support replay event transformations - #7274

Merged
mihir20 merged 6 commits into
masterfrom
fix-replay-destid
Aug 17, 2026
Merged

mihir20 merged 6 commits into
masterfrom
fix-replay-destid

Conversation

@mihir20

@mihir20 mihir20 commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Problem

During an event replay, ApplyReplaySources creates replay destinations as copies of the original destinations with new IDs (backend-config/replay_types.go). That new replay destination ID is what reaches user transformations via metadata(event).destinationId.

Any user transformation that branches on destination ID (e.g. matching hardcoded original destination IDs to route/filter events) can therefore never match during a replay — every replayed event gets filtered, even though the same transformation works correctly for live traffic.

The platform already solves this exact problem for source IDs: the user transformer flips sourceId ↔ originalSourceId before calling the transformation and flips them back on the response, so transformations always see the original source ID. Destinations never got the same treatment.

Fix

Mirror the existing source-ID mechanism for destination IDs:

  • backend-config: DestinationT gets an OriginalID field (same as SourceT), populated by ApplyReplaySources when building replay destinations.
  • processor: Metadata gets OriginalDestinationID (json:"originalDestinationId,omitempty"), stamped alongside the other destination metadata after the tracking-plan flow and carried through CommonMetadata(). omitempty keeps non-replay payloads unchanged.
  • user_transformer: sendBatch flips destinationId ↔ originalDestinationId (alongside the existing source flip) before calling the transformation, and Transform flips them back on every response, including failed events.

Scope is deliberately identical to the source-ID behavior: only the user-transformation payload sees the original destination ID. Everything downstream (destination transformation, router, reporting, stats) keeps the replay destination ID, which remains the actual delivery target.

Tests

  • New unit test in user_transformer_test.go verifying the transformation receives the original source and destination IDs and the response carries the replay IDs restored (runs across all three HTTP client types).
  • TestApplyReplayConfig extended to assert OriginalID is set on replay destinations.

Linear Ticket

pipe-3282

Security

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

…t transformations

🔒 Scanned for secrets using gitleaks 8.28.0
@mihir20
mihir20 marked this pull request as ready for review August 17, 2026 08:07
…configuration for tests

🔒 Scanned for secrets using gitleaks 8.28.0
… values from JSON

🔒 Scanned for secrets using gitleaks 8.28.0
@mihir20
mihir20 requested review from atzoum and ktgowtham August 17, 2026 08:46
Comment thread backend-config/types.go Outdated
ID string
ID string
// OriginalID is the ID of the original destination for replay destinations
OriginalID string `json:"-"`

@atzoum atzoum Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are caching configs as json in the database, by ignoring this field we would be omitting it if backend config is unavailable and we load a cached version. omitempty can be used instead

@codecov

codecov Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.67%. Comparing base (9d6f7cf) to head (ac05347).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7274      +/-   ##
==========================================
- Coverage   79.69%   79.67%   -0.03%     
==========================================
  Files         601      601              
  Lines       67184    67191       +7     
==========================================
- Hits        53544    53535       -9     
- Misses      10474    10488      +14     
- Partials     3166     3168       +2     

☔ 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.

…icts during unmarshalling

🔒 Scanned for secrets using gitleaks 8.28.0
@mihir20
mihir20 requested a review from atzoum August 17, 2026 09:16
…in JSON tagging

🔒 Scanned for secrets using gitleaks 8.28.0
@mihir20
mihir20 merged commit 28d38e9 into master Aug 17, 2026
76 checks passed
@mihir20
mihir20 deleted the fix-replay-destid branch August 17, 2026 11:18
This was referenced Aug 17, 2026
mihir20 pushed a commit that referenced this pull request Aug 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.83.0-rc.1](v1.82.0...v1.83.0-rc.1)
(2026-08-17)


### Features

* add OriginalID and OriginalDestinationID to support replay event
transformations
([#7274](#7274))
([28d38e9](28d38e9))
* bingads integration tests
([#7253](#7253))
([fdb8c0a](fdb8c0a))
* **processor:** fork event processing for rsources pipelines
([#7235](#7235))
([707ea06](707ea06))


### Bug Fixes

* pyt contract tests data race
([#7247](#7247))
([9e62d0c](9e62d0c))


### Miscellaneous

* bump sqlconnect-go to v1.30.2
([#7251](#7251))
([f5d6175](f5d6175))
* **jobsdb:** multi-consumer compaction improvements
([#7248](#7248))
([b4af86c](b4af86c))
* pyt contract tests for candidate releases
([#7252](#7252))
([149e91a](149e91a))
* pyt contract tests for transformations auth
([#7239](#7239))
([ac4a859](ac4a859))
* **router:** support per-partition noOfWorkers override
([#7270](#7270))
([9d6f7cf](9d6f7cf))
* sync release v1.82.0 to main branch
([#7243](#7243))
([a6e29f2](a6e29f2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
mihir20 pushed a commit that referenced this pull request Aug 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.83.0](v1.82.0...v1.83.0)
(2026-08-17)


### Features

* add OriginalID and OriginalDestinationID to support replay event
transformations
([#7274](#7274))
([28d38e9](28d38e9))
* bingads integration tests
([#7253](#7253))
([fdb8c0a](fdb8c0a))
* **processor:** fork event processing for rsources pipelines
([#7235](#7235))
([707ea06](707ea06))


### Bug Fixes

* pyt contract tests data race
([#7247](#7247))
([9e62d0c](9e62d0c))


### Miscellaneous

* bump sqlconnect-go to v1.30.2
([#7251](#7251))
([f5d6175](f5d6175))
* **jobsdb:** multi-consumer compaction improvements
([#7248](#7248))
([b4af86c](b4af86c))
* pyt contract tests for candidate releases
([#7252](#7252))
([149e91a](149e91a))
* pyt contract tests for transformations auth
([#7239](#7239))
([ac4a859](ac4a859))
* **router:** support per-partition noOfWorkers override
([#7270](#7270))
([9d6f7cf](9d6f7cf))
* sync release v1.82.0 to main branch
([#7243](#7243))
([a6e29f2](a6e29f2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
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.

3 participants