fix: correct asset URL rewriting during push (PROD-915)#120
Open
AaronAgility wants to merge 2 commits intolatest-betafrom
Open
fix: correct asset URL rewriting during push (PROD-915)#120AaronAgility wants to merge 2 commits intolatest-betafrom
AaronAgility wants to merge 2 commits intolatest-betafrom
Conversation
The mapAssetUrl method was accessing originUrl/url/edgeUrl on an AssetMapping object, but those properties only exist on mgmtApi.Media. The `as any` cast masked the type error, causing every lookup to fall through to returning the original source URL unchanged. Now correctly returns assetMapping.targetUrl when a mapping is found. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Asset mappings now store container edge/origin URLs and use them as a fallback when exact URL matching fails. This handles content items that reference assets via subfolder paths (e.g. /mobile/feature-carousel/) which differ from the root edgeUrl stored in the mapping. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
mapAssetUrlmethod incontent-field-mapper.tswas accessingoriginUrl,url, andedgeUrlon anAssetMappingobject — properties that don't exist on that type. Theas anycast masked the TypeScript error, causing every asset URL lookup to silently fall through and return the original source URL unchanged. Asset URLs were never being rewritten during push operations.as anycast and now correctly returnsassetMapping.targetUrl(the target instance's edge URL) when a mapping is found, falling back to the originalsourceUrlonly whentargetUrlis not set.References
PROD-915
Test plan
as anyneeded)🤖 Generated with Claude Code