| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…om fields Marketplace-app / extension references embedded in entry DATA (e.g. an `image_presets` value's `metadata.extension_uid`) are stack-scoped and must be remapped to the destination app's extension_uid during import. The remap in `lookupAssets` (`findAssetIdsFromJsonCustomFields`) only walked top-level schema fields, so any `is_asset` JSON custom field nested inside a group / global_field / blocks was skipped. Consequences of the miss: - the entry kept the source app's extension_uid, leaving an orphaned reference on the destination stack; and - on a subsequent import the audit flagged that UID as a missing reference and stripped the whole field (silent data loss of image-preset configs). Replace the flat `ctSchema.map` with a recursive walk (`remapJsonCustomFieldExtensionUids`) that follows the entry-data shape through group / global_field / blocks and handles multiple-valued fields, remapping `metadata.extension_uid` (and the schema field's extension_uid) via the marketplace_apps mapping. 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. |
Sorry, something went wrong.
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
Sorry, something went wrong.
| const values = Array.isArray(value) ? value : [value]; | ||
| for (const val of values) { | ||
| const currentUid = val?.metadata?.extension_uid; | ||
| if (currentUid && installedExtensions && installedExtensions[currentUid]) { |
There was a problem hiding this comment.
can we use switch case here instead of multiple if...else
Sorry, something went wrong.
There was a problem hiding this comment.
This PR remaps marketplace extension UIDs in nested JSON asset fields during imports.
Changes:
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| } else if (data_type === 'group' || data_type === 'global_field') { | ||
| remapJsonCustomFieldExtensionUids(field.schema, value); | ||
| } else if (data_type === 'blocks' && Array.isArray(field.blocks)) { | ||
| const blockInstances = Array.isArray(value) ? value : [value]; | ||
| for (const blockInstance of blockInstances) { |
| } else if (data_type === 'group' || data_type === 'global_field') { | ||
| remapJsonCustomFieldExtensionUids(field.schema, value); |
…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>
… fix/dx-7312-entry-data-extension-uid-remap
🔒 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 |
Sorry, something went wrong.
Address PR review on the entry-data remap: - Replace the schema-driven walker with `remapEntryMetadataExtensionUids`, a schema-independent deep walk of the entry data that remaps any `metadata.extension_uid` via the marketplace_apps mapping. This is robust to is_asset custom fields nested in group / global_field / blocks AND to content-type schemas that carry a reference-only global_field stub (no expanded `schema`, e.g. from query-export), which the previous schema-driven walk would silently skip. - Run it once, unconditionally, after `find()` (idempotent — already-mapped UIDs are no-ops). - Guard `find()` against a missing schema so a global_field stub no longer throws while collecting assets. - Keep the schema field `extension_uid` remap for parity. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🔒 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 |
Sorry, something went wrong.
Address PR review on the entry-data remap: - Replace the schema-driven walker with `remapEntryMetadataExtensionUids`, a schema-independent deep walk of the entry data that remaps any `metadata.extension_uid` via the marketplace_apps mapping. This is robust to is_asset custom fields nested in group / global_field / blocks AND to content-type schemas that carry a reference-only global_field stub (no expanded `schema`, e.g. from query-export), which the previous schema-driven walk would silently skip. - Run it once, unconditionally, after `find()` (idempotent — already-mapped UIDs are no-ops). - Guard `find()` against a missing schema so a global_field stub no longer throws while collecting assets. - Keep the schema field `extension_uid` remap for parity. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🔒 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 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Closes both halves of DX-7312 (marketplace-app extension UIDs not remapped on clone/import):
Root Causes & Fixes
1. Entry-data remap — utils/asset-helper.ts
lookupAssets → findAssetIdsFromJsonCustomFields only walked top-level schema fields, so an is_asset JSON custom field nested inside a group / global_field / blocks never had its metadata.extension_uid remapped → orphaned reference → the audit deleted the field (silent data loss).
Fix: replaced the flat map with a recursive walk (remapJsonCustomFieldExtensionUids) that follows the entry-data shape through group / global_field / blocks, handles multiple-valued fields, and remaps via the marketplace_apps mapper.
2. Marketplace config decrypt resilience — import/modules/marketplace-apps.ts
updateAppsConfig decrypted inline as the call argument:
nodeCrypto.decrypt is synchronous, so a bad-decrypt (ERR_OSSL_BAD_DECRYPT — an app config encrypted with a different key) threw outside the promise chain's .catch, propagated through installApps (which re-throws), and aborted the entire marketplace-apps module → mapper/marketplace_apps/uid-mapping.json was never written → GF/CT/entry remap had nothing to map against.
Fix: decrypt inside a try/catch for both configuration and server_configuration. On failure, log a warn and skip only that app's config push. The app stays installed, its extension_uid mapping is still recorded, the module completes, and the mapping file is written.
Testing
Validated with the dev CLI (node bin/dev cm:stacks:import) into fresh stacks:
🤖 Generated with Claude Code