Repository navigation
fix(intercom): keep mapped external_id in rETL v2 identify regardless of email - #5735
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
🟡 Changes recommended
The shared workflow also preserves external_id in API v1 requests, contrary to the stated v2-only scope.
1 open issue
What changed in this PR
This follow-up to #5730 preserves explicitly mapped external_id values when email is present in Intercom API v2 rETL identify payloads.
Changes:
- Replaces unconditional
external_idassignment with a conditionaluser_idfallback. - Updates the existing regression fixture to expect both email and the mapped
external_id.
| File | Description |
|---|---|
test/integrations/destinations/intercom/processor/identifyTestData.ts |
Updates the expected identify payload and success criteria. |
src/cdk/v2/destinations/intercom/procWorkflow.yaml |
Preserves mapped IDs and conditionally applies the fallback. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5735 +/- ##
========================================
Coverage 92.40% 92.40%
========================================
Files 737 737
Lines 40859 40859
Branches 9586 9587 +1
========================================
Hits 37754 37754
+ Misses 2921 2844 -77
- Partials 184 261 +77 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… of email The rETL v2 payload step still forced external_id to null whenever email was present, dropping an explicitly mapped external_id. Only fill external_id when it is missing: keep a mapped value as is, and fall back to user_id only when email is not present. API v1 is left untouched. Follow-up to INT-7442 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add rETL v2 identify cases for: - user_id identifier plus a different mapped external_id without email: the mapped external_id wins - email as the rETL identifier: no external_id is derived - no email, user_id or external_id: identify fails with "Either email or userId is required" Co-Authored-By: Claude Opus 5.5 <[email protected]>
943a83b to
98d75ee
Compare
|
#5735 was reverted from the release in #5738 after the changelog was generated, so it does not ship in v1.166.0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#5735 was reverted from the release in #5738 after the changelog was generated, so it does not ship in v1.166.0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
## What are the changes introduced in this PR? Removes the #5735 entry from the v1.166.0 section of `CHANGELOG.md`. The changelog was generated in `chore(release): v1.166.0` before #5735 was reverted from the release in #5738, so it still listed #5735 as shipping. With the revert, nothing from #5735 ships in v1.166.0. Replaces #5740, whose commit message failed commitlint (`footer-max-line-length`: a body line starting with `#5735` is parsed as a footer). Same change, reworded commit message. ## What is the related Linear task? Related to INT-7442 ## Please explain the objectives of your changes below Keep the v1.166.0 changelog accurate. ### Any changes to existing capabilities/behaviour, mention the reason & what are the changes ? N/A — changelog only. ### Any new dependencies introduced with this change? N/A ### Any new generic utility introduced or modified. Please explain the changes. N/A ### Any technical or performance related pointers to consider with the change? N/A <hr> ### Developer checklist - [x] My code follows the style guidelines of this project - [x] **No breaking changes are being introduced.** - [x] All related docs linked with the PR? - [x] All changes manually tested? - [ ] Any documentation changes needed with this change? - [x] Is the PR limited to 10 file changes? - [x] Is the PR limited to one linear task? - [ ] Are relevant unit and component test-cases added in **new readability format**? ### Reviewer checklist - [ ] Is the type of change in the PR title appropriate as per the changes? - [ ] Verified that there are no credentials or confidential data exposed with the changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)




What are the changes introduced in this PR?
Follow-up to #5730. In the Intercom rETL (
mappedToDestination) identify flow for API v2,rEtlPayloadstill forcedexternal_idtonullwhenever email was present, dropping an explicitly mappedexternal_id.This replaces the forced assignment with a conditional one that only fills
external_idwhen it is missing:What is the related Linear task?
Related to INT-7442
Please explain the objectives of your changes below
On v2 rETL, an
external_idthat was mapped (e.g. viaidentifierType: external_id) should always reach Intercom, anduser_idshould only be used as a fallback when there is no email.Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
external_idmapped, no emailexternal_idmapped, email presentuser_id, no emailexternal_id = user_idexternal_id = user_iduser_id, email presentexternal_idexternal_idAPI v1 and event stream are unchanged.
Only setups that put
external_idinto the rETL traits themselves are affected (the mapper only offersuser_id/emailas identifiers — see INT-7448). For their records with an email, the contact matched by email now also gets the mappedexternal_id; Intercom may return a 409 if a different contact already owns thatexternal_id.Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
N/A
Any technical or performance related pointers to consider with the change?
N/A
Developer checklist
My code follows the style guidelines of this project
No breaking changes are being introduced.
All related docs linked with the PR?
All changes manually tested?
Any documentation changes needed with this change?
Is the PR limited to 10 file changes?
Is the PR limited to one linear task?
Are relevant unit and component test-cases added in new readability format?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.
Testing
intercom-identify-test-22(external_id+ email) now expectsexternal_idin the PUT body. It fails on currentdevelopand passes with this change.intercom-identify-test-23:user_ididentifier plus a different mappedexternal_id, no email → the mappedexternal_idwins (fails on the code before fix(intercom): keep mapped external_id in rETL v2 flow when email is absent #5730).intercom-identify-test-24:identifierType: email→ noexternal_idderived.intercom-validation-test-11: no email,user_idorexternal_id→Either email or userId is required for Identify call.🤖 Generated with Claude Code