fix(import): survive marketplace app config decrypt failure (unblocks GF/CT remap) [DX-7312] - #360
Closed
harshitha-cstk wants to merge 1 commit into
Closed
Conversation
…borting the module `updateAppsConfig` called `nodeCrypto.decrypt(configuration)` inline as the argument to `.setConfiguration(...)` / `.setServerConfig(...)`. A bad-decrypt (e.g. ERR_OSSL_BAD_DECRYPT when an app's exported `configuration` was encrypted with a different key) therefore threw synchronously — outside the promise chain's `.catch` — and propagated up through `installApps` (which re-throws), aborting the entire marketplace-apps module. Because the module aborted, `mapper/marketplace_apps/uid-mapping.json` was never written. Global fields / content types (and entry data) then had no marketplace extension mapping to remap against, so their imports failed with "extension_uid ... does not exist in destination stack". Fix: decrypt inside a try/catch for both configuration and server_configuration. On failure, log a warning and skip only that app's config push; the app stays installed and its extension_uid mapping is still recorded, so downstream GF/CT/entry remapping works and the uid-mapping file is written. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Contributor
Author
|
closing the PR as i have merged it to #359 |
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.
Summary
Fixes the marketplace-app path that caused the GF/CT half of DX-7312: on a stack with an app whose exported
configurationcan't be decrypted, the whole marketplace-apps module aborted before writing its UID mapping, which then starved the global-field / content-type / entry extension remap (extension_uid ... does not exist in destination stack).Root cause
updateAppsConfigdecrypted inline as the call argument:nodeCrypto.decryptruns synchronously, so a bad-decrypt (ERR_OSSL_BAD_DECRYPT, e.g. the export was encrypted with a different key) throws before the promise chain's.catch— it escapesupdateAppsConfig, hitsinstallApps'sthrow error, and aborts the module.mapper/marketplace_apps/uid-mapping.jsonis then never written, so GF/CT/entry extension remapping has nothing to map against.Fix
Decrypt inside a
try/catchfor bothconfigurationandserver_configuration. On failure: log awarnand skip only that app's config push. The app stays installed, itsextension_uidmapping is still recorded, and the module completes and writes the UID mapping.Testing
node bin/dev cm:stacks:importof the previously-failing export (app config triggersERR_OSSL_BAD_DECRYPT) into a fresh stack:marketplace_apps/uid-mapping.jsonempty, GFpage_banner/tablefailed withextension_uid ... does not exist.WARN: Failed to decrypt configuration for 'Image Preset Builder' ... skipping; Install Apps 4/4; UID mapping written with 8 extension mappings; Global Fields 36/36, 0extension does not existerrors.(Unrelated pre-existing failures in that particular export — CTs referencing a
featured_articlesglobal field that is absent from the package — are out of scope and predate this change.)🤖 Generated with Claude Code