Skip to content

bug/2544 Fix shared dataExtension fields not resolved in journey UPDATECONTACTDATA activity#2546

Merged
JoernBerkefeld merged 5 commits intodevelopfrom
copilot/fix-shared-dataextension-fields
Mar 14, 2026
Merged

bug/2544 Fix shared dataExtension fields not resolved in journey UPDATECONTACTDATA activity#2546
JoernBerkefeld merged 5 commits intodevelopfrom
copilot/fix-shared-dataextension-fields

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

Three bugs in journey UPDATECONTACTDATA activity processing when working with shared dataExtensions:

  1. DE not found → crash + full field retrieve: When a DE ObjectID wasn't in cache, the code called retrieveFieldsForSingleDe(undefined), causing a SOAP error and triggering a full scan of all dataExtensionField records.
  2. Shared DE fields never resolved: Fields of shared DEs live on the parent BU; the existing code only checked the local dataExtensionField cache and always failed for shared DEs.
  3. No cache when retrieving journey without dataExtension: DataExtension.attachFields() (called during DE retrieve) attaches fields to DE objects in memory but does not populate cache.dataExtensionField. The handler must always fetch fields on-demand.

Changes

DataExtensionField.js

  • isSharedDe(customerKey) — checks the DE's CategoryID against the parent-BU folder cache; returns true if the folder's ContentType is in folderTypesFromParent
  • retrieveFieldsForSingleSharedDe(customerKey) — temporarily swaps buObject/client to parent BU, calls retrieveFieldsForSingleDe(), then restores — same pattern as DataExtension.retrieveSharedForCache; includes null-guard for misconfigured credentials
  • retrieveFieldsForSingleDeAuto(customerKey) — routes to shared or local retrieval automatically, eliminating repeated ternary logic at call sites

Journey.jsUPDATECONTACTDATA in both _postRetrieveTasks_activities and _preDeployTasks_activities

Scenario Before After
DE ObjectID not in cache retrieveFieldsForSingleDe(undefined) → SOAP crash → full field scan warn + silently skip
No dataExtensionField cache always assumed local isSharedDe() → correct BU
Cache exists, field missing hard failure re-fetch via retrieveFieldsForSingleDeAuto() with alreadyFetchedDe guard

Tests

  • mcdev retrieve cred/bu -m journey — all journeys including local-DE and shared-DE UPDATECONTACTDATA (existing)
  • mcdev retrieve cred/bu -m journey dataExtensionnew: combined retrieve; verifies DataExtension.attachFields() does not pollute cache.dataExtensionField and field resolution still uses the correct per-DE fetch path for both local and shared DEs
  • Key-based retrieve and deploy tests for both local-DE and shared-DE UPDATECONTACTDATA journeys (added in initial fix commit)

Documentation

No wiki changes required.

Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] shared dataExtension fields not resolved in journey "update contact" activity</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

tried retrieving a journey with a "update contact" activity which targets a shared dataExtension.
those seem to be cached but not their fields
Image

even worse when we run the dataExtension isnt found then the subsequent field retrieve also fails to be stopped and throws a javascript error followed by a FULL retrieve of all fields - which should not start at all if the dataExtension wasnt found.

Image

Expected Behavior

if a shared DE was recognized then its fields shall be cached.

Steps To Reproduce

  1. mcdev retrieve cred/bu -m journey:testKey
  2. see above error

Version

9.0.2

Environment

  • OS:
  • Node:
  • npm:

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response</issue_description>

<agent_instructions>if the dataExtension wasnt found, the code should not attempt to retrieve the field or to get it from cache but silently skip that step.

if the dataExtension was found:
the current code seems to rely on an existing cache and always fails if that exists but the field couldnt be found in it. if the respective dataExtension was shared though, this cache will likely NOT contain the field in the first place, hence we would then need to run DataExtensionField.retrieveFieldsForSingleDe() with DataExtensionField.buObject set to a similar value as done in DataExtension.retrieveSharedForCache.

since the above is something likely happening for other types than journey as well, we should have a new method in DataExtensionField, or check if there is already a solution for that in the class.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@JoernBerkefeld fyi @yuliialikhyt

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI changed the title [WIP] [BUG] Fix shared dataExtension fields resolution in journey update contact activity #2038 Fix shared dataExtension fields not resolved in journey UPDATECONTACTDATA activity Mar 14, 2026
Copilot AI requested a review from JoernBerkefeld March 14, 2026 09:24
@JoernBerkefeld JoernBerkefeld changed the title #2038 Fix shared dataExtension fields not resolved in journey UPDATECONTACTDATA activity bug/2544 Fix shared dataExtension fields not resolved in journey UPDATECONTACTDATA activity Mar 14, 2026
@JoernBerkefeld JoernBerkefeld added this to the 9.0.3 - dataExtensions milestone Mar 14, 2026
@github-actions
Copy link

github-actions bot commented Mar 14, 2026

Coverage Report

Commit:aefcc76
Base: develop@f8ce74c

Type Base This PR
Total Statements Coverage  71.11%  71.05%  (-0.06%)
Total Branches Coverage  70.83%  70.77%  (-0.06%)
Total Functions Coverage  83.71%  83.77%  (+0.06%)
Total Lines Coverage  71.11%  71.05%  (-0.06%)
Details (changed files):
File Statements Branches Functions Lines
lib/metadataTypes/DataExtensionField.js  82.32%  69.11%  92.85%  82.32%
lib/metadataTypes/Journey.js  67.87%  66.43%  96%  67.87%

@JoernBerkefeld JoernBerkefeld marked this pull request as ready for review March 14, 2026 22:57
Copilot AI and others added 4 commits March 15, 2026 00:02
…ivity

Co-authored-by: JoernBerkefeld <1917227+JoernBerkefeld@users.noreply.github.com>
…ngleSharedDe

Co-authored-by: JoernBerkefeld <1917227+JoernBerkefeld@users.noreply.github.com>
…hared DE helpers

Co-authored-by: JoernBerkefeld <1917227+JoernBerkefeld@users.noreply.github.com>
@JoernBerkefeld JoernBerkefeld force-pushed the copilot/fix-shared-dataextension-fields branch from 09f26c0 to aefcc76 Compare March 14, 2026 23:07
@JoernBerkefeld JoernBerkefeld merged commit ab8a090 into develop Mar 14, 2026
10 checks passed
@JoernBerkefeld JoernBerkefeld deleted the copilot/fix-shared-dataextension-fields branch March 14, 2026 23:08
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.

[BUG] shared dataExtension fields not resolved in journey "update contact" activity

2 participants