Skip to content

bug/1838 fix shared DEs not resolved if linking type is retrieved together with dataExtensions#2545

Merged
JoernBerkefeld merged 2 commits intodevelopfrom
copilot/fix-shared-des-not-resolved
Mar 14, 2026
Merged

bug/1838 fix shared DEs not resolved if linking type is retrieved together with dataExtensions#2545
JoernBerkefeld merged 2 commits intodevelopfrom
copilot/fix-shared-des-not-resolved

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

When running mcdev r cred/bu -m dataExtension query (or dataExtension attributeSet), shared DEs from the parent BU were never cached — causing r__dataExtension_key lookups to fail silently with warnings.

Root cause

Retriever.js calls retrieveSharedForCache() when a type is both being retrieved and a dependency of another type in the same run. The return value is a plain DataExtensionMap, but the code incorrectly accessed .metadata on it:

// Before (broken)
const cacheSharedResult = await MetadataTypeInfo[type].retrieveSharedForCache();
cache.mergeMetadata(type, cacheSharedResult.metadata); // undefined → no-op
// After (fixed)
const cacheSharedResult = await MetadataTypeInfo[type].retrieveSharedForCache();
cache.mergeMetadata(type, cacheSharedResult); // plain map merged correctly

This only manifests in the combined-retrieve path — standalone query or attributeSet retrieval already worked because retrieveForCache calls retrieve(null, ...) internally, which invokes retrieveSharedForCache directly.

Test coverage added

  • type.query.test.js: New test fixture testExisting_query_SharedDE (targets shared DE testExisting_dataExtensionShared via ObjectID 21711373-72c1-ec11-b83b-shared). New test Should resolve shared dataExtensions in query when retrieved together with dataExtension asserts r__dataExtension_key is correctly resolved in combined retrieval. Updated existing query count assertions (4→5 retrieve, 5→6 deploy).
  • type.attributeSet.test.js: New test Should resolve shared dataExtensions in attributeSet when retrieved together with dataExtension asserts that testExisting_dataExtensionShared attributeSet gets r__dataExtension_key set correctly under the same combined-retrieve scenario.
Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] shared DEs not resolved if query+attributeSet is retrieved together with dataExtensions</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

if you run mcdev r cred/bu -m dataExtension query and your query is supposed to write into a shared DE then that is not found because it is not cached during the retrieve process
same for attributeSet: mcdev r cred/bu -m dataExtension attributeSet will fail to resolve shared dataExtensions in attributeSets.

image

Related to:

Expected Behavior

shared DEs should be cached on the parent BU's cache and when querys are downloaded it should simply check if that cache is existing and if not, trigger caching it.

Steps To Reproduce

workaround: re-retrieve queries and attributeSet on their own, without also retrieving dataExtensions:

  • mcdev r cred/bu -m attributeSet
  • mcdev r cred/bu -m query

Version

7.4.4

Environment

  • OS:
  • Node:
  • npm:

Participation

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

Additional comments

No response</issue_description>

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


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

…attributeSet

Co-authored-by: JoernBerkefeld <1917227+JoernBerkefeld@users.noreply.github.com>
Copilot AI changed the title [WIP] [BUG] Fix shared DEs not resolved during query and attributeSet retrieval #1937 fix shared DEs not resolved if query+attributeSet is retrieved together with dataExtensions Mar 13, 2026
Copilot AI requested a review from JoernBerkefeld March 13, 2026 22:32
@github-actions
Copy link

github-actions bot commented Mar 13, 2026

Coverage Report

Commit:8223949
Base: develop@5265eeb

Type Base This PR
Total Statements Coverage  71.11%  71.11%  (+0%)
Total Branches Coverage  70.83%  70.83%  (+0%)
Total Functions Coverage  83.71%  83.71%  (+0%)
Total Lines Coverage  71.11%  71.11%  (+0%)
Details (changed files):
File Statements Branches Functions Lines

@JoernBerkefeld JoernBerkefeld marked this pull request as ready for review March 14, 2026 07:01
@JoernBerkefeld JoernBerkefeld added this to the 9.0.3 - dataExtensions milestone Mar 14, 2026
@JoernBerkefeld JoernBerkefeld changed the title #1937 fix shared DEs not resolved if query+attributeSet is retrieved together with dataExtensions bug/1838 fix shared DEs not resolved if query+attributeSet is retrieved together with dataExtensions Mar 14, 2026
@JoernBerkefeld JoernBerkefeld merged commit f8ce74c into develop Mar 14, 2026
15 checks passed
@JoernBerkefeld JoernBerkefeld deleted the copilot/fix-shared-des-not-resolved branch March 14, 2026 08:26
@JoernBerkefeld JoernBerkefeld changed the title bug/1838 fix shared DEs not resolved if query+attributeSet is retrieved together with dataExtensions bug/1838 fix shared DEs not resolved if query/attributeSet/journey is retrieved together with dataExtensions Mar 14, 2026
@JoernBerkefeld JoernBerkefeld changed the title bug/1838 fix shared DEs not resolved if query/attributeSet/journey is retrieved together with dataExtensions bug/1838 fix shared DEs not resolved if linking type is retrieved together with dataExtensions Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/attributeSet COMPONENT c/dataExtension COMPONENT c/dataExtract COMPONENT c/dataFilter COMPONENT (filterDefinition) c/emailSend COMPONENT c/importFile COMPONENT c/journey COMPONENT c/query COMPONENT c/transactionalEmail c/verification COMPONENT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] shared DEs not resolved if query/attributeSet/journey is retrieved together with dataExtensions

2 participants