Skip to content

Conversation

@justinjxzhang
Copy link
Collaborator

@justinjxzhang justinjxzhang commented Sep 8, 2025

PR details

When you retrieve for a something that depends on dataExtension, mcdev will automatically try to reach out to retrieve the Parent BU's Shared dataExtensions. However, if the credentials used lack the permissions to query the Parent BU the response will be empty. There's currently an assumption that the response will not be empty and so when we try to access the property it's undefined; and we try to use map on that undefined property and the retrieval fails.

We don't think being unable to retrievve shared dataExtensions should break the retrieval flow, so we're suggesting to simply null-coalesce to an empty array so there's something for the rest of the code to operate on.

What changes did you make? (Give an overview)

  • Null coalesce a response.Results so it is not undefined, so subsequent accessing of the variable won't throw.
  • Added a test for the above

Further details (optional)

...

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • test scripts updated
  • Wiki updated (if applicable)

@github-actions
Copy link

github-actions bot commented Sep 8, 2025

Coverage Report

Commit:db42cff
Base: main@2062a69

Type Base This PR
Total Statements Coverage  70.77%  70.77%  (+0%)
Total Branches Coverage  70.83%  70.82%  (-0.01%)
Total Functions Coverage  83.35%  83.35%  (+0%)
Total Lines Coverage  70.77%  70.77%  (+0%)
Details (changed files):
File Statements Branches Functions Lines
lib/metadataTypes/Folder.js  67.45%  63.2%  100%  67.45%

@justinjxzhang justinjxzhang force-pushed the null-coalesce-shared-de-failures branch from 1b38191 to db42cff Compare September 8, 2025 10:07
@justinjxzhang justinjxzhang merged commit b14da4a into main Sep 11, 2025
8 checks passed
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.

2 participants