Repository navigation
test(hs): verify merged contact updates reach survivor - #5748
shekhar-rudder merged 4 commits into
Conversation
|
👋 I'm rudder-devbox. I opened this PR from task Mention |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5748 +/- ##
========================================
Coverage 92.42% 92.42%
========================================
Files 741 741
Lines 41048 41048
Branches 9553 9636 +83
========================================
Hits 37938 37938
+ Misses 2926 2848 -78
- Partials 184 262 +78 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Resolve every registered contact id to its current id and delete each once, in parallel, instead of tracking the merge in a module-level WeakMap and registering an unread survivor id. This also cleans up when the merge landed although its request failed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
A failed resolution GET excludes an unrelated contact from cleanup despite its valid registered ID, potentially leaving a live sandbox contact behind instead of attempting best-effort deletion.
1 open issue
What changed in this PR
Updates HubSpot’s live merged-contact scenario to require both batch updates to succeed and verify that the merged-away ID’s update reaches the survivor. Delivery-handler logic remains unchanged.
Changes:
- Require successful delivery and read-back for both contacts.
- Resolve registered contact IDs during cleanup and deduplicate deletion targets.
- Preserve mocked silent-omission coverage with merge-neutral descriptions and error wording.
| File | Description |
|---|---|
test/integrations/destinations/hs/network.ts |
Clarifies comments describing synthetic silent-omission responses. |
test/integrations/destinations/hs/live/scenarios.ts |
Requires both updates to succeed and uses merge-aware cleanup. |
test/integrations/destinations/hs/live/api.ts |
Adds contact ID resolution and deduplicated cleanup. |
test/integrations/destinations/hs/dataDelivery/upsert.ts |
Updates omission-case naming and expected error wording. |
src/v1/destinations/hs/networkHandler.ts |
Revises documentation and error text without changing handler logic. |
Review effort: Balanced
HubSpot contact DELETE is idempotent and deleting through a merged-away id removes the survivor, so the resolve-then-delete teardown is unnecessary. It also skipped the unrelated contact whenever its lookup failed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|





What are the changes introduced in this PR?
Require both jobs in HubSpot’s merged-record live batch to deliver, verify the update on the surviving contact, and clean up the survivor and unrelated contact. Preserve mocked regression coverage for silently omitted batch inputs with merge-neutral wording.
What is the related Linear task?
Resolves INT-7466
Please explain the objectives of your changes below
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
The merged-record live scenario previously expected failure for the merged-away ID. HubSpot now resolves that ID and echoes its trace ID, so the scenario requires successful delivery and read-back instead. No delivery-handler logic changed.
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?
Cleanup deletes the actual survivor only once. If a merge succeeds but both the merge response and fallback GET fail to identify the survivor, teardown falls back to the registered original IDs and may report a deletion failure.
Validation
npm run lint;npx tsc --noEmit -p tsconfig.test.json;npm test -- --testPathPattern="hs" --no-coverage(223 tests);npm run test:ts -- component --destination=hs(86 tests);git diff --check.HS: ["headers.Authorization"]entry; the full generated artifact was restored and has no diff.LIVE_SECRET_HSis unavailable. Both credential variants and remote cleanup still need verification. No PR was created or Slack link posted.LOG_LEVEL=silent npm run test:live -- --destination=hsremains unrun becauseLIVE_SECRET_HSis unavailable. Both credential variants, remote survivor cleanup, and a greenlive (hs)run on develop remain unverified.Developer checklist
Reviewer checklist
Adversarial self-review surfaced findings that were not auto-fixed. Each carries its disposition — please evaluate before merging.
test/integrations/destinations/hs/live/setup.ts:106— not auto-fixed (iteration budget exhausted)