Repository navigation
bug/2400: prevent folder creation skip when same path exists in another BU - #2533
Merged
Merged
Conversation
…her BU Co-authored-by: JoernBerkefeld <[email protected]>
Co-authored-by: JoernBerkefeld <[email protected]>
Co-authored-by: JoernBerkefeld <[email protected]>
Copilot
AI
changed the title
[WIP] Fix issue with asset folder creation in different business units
fix: prevent folder creation skip when same path exists in another BU
Mar 5, 2026
JoernBerkefeld
approved these changes
Mar 5, 2026
Coverage ReportCommit:168060bBase: develop@9cc40d9
Details (changed files):
|
JoernBerkefeld
approved these changes
Mar 5, 2026
This was
linked to
issues
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When deploying to a BU whose folder cache contains a same-path folder owned by a different BU (common when the SFMC API returns cross-BU folders),
Folder.upsertwould match that foreign folder viagetFolderByPath(allowOtherBu=truedefault), skip creation, and leave the asset deployment referencing an invalid category ID — resulting inUnable to find a Category whose Id is 'XXXXX'.Changes
lib/metadataTypes/Folder.js— PassallowOtherBu = falsetocache.getFolderByPath()inFolder.upsert. Only an exactClient.ID === currentMIDmatch should be treated as "folder already exists"; a same-path folder from another BU must not suppress creation.test/type.folder.test.js+ test fixtures — New test injects aContent Builder/testFolder_samePathfolder withClient.ID=1111111(foreign BU) into the retrieve response fortestBU(MID=9999999), then deploys the same path. Without the fix:0 created / 1 filtered. With fix:1 created..husky/post-checkout,.husky/commit-msg— Replaced bash-specific[[/IFS=$'\n'/ array expansion with POSIX-compatible equivalents; husky runs hooks viash -e, so these were failing silently in CI.Issues
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.