Skip to content

fix(vtex): rewrite legacy decocache/decoassets video URLs to decoims.com - #1626

Open
aline-pereira wants to merge 1 commit into
mainfrom
fix/rewrite-legacy-video-urls
Open

fix(vtex): rewrite legacy decocache/decoassets video URLs to decoims.com#1626
aline-pereira wants to merge 1 commit into
mainfrom
fix/rewrite-legacy-video-urls

Conversation

@aline-pereira

@aline-pereira aline-pereira commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Problem

VTEX product catalogs may have videos registered with assets.decocache.com or data.decoassets.com URLs. These are passed through as-is in toProductfinalVideoscontentUrl, generating Azion proxy requests on every PDP load.

Fix

One-line regex replace at the point where the url is set in finalVideos:

const url = video.replace(
  /^https:\/\/(?:assets\.decocache\.com|data\.decoassets\.com)\//,
  "https://decoims.com/",
);

Impact

  • Affects all VTEX sites using deco-cx/apps
  • Fixes Azion proxy requests from product video fields without requiring VTEX catalog updates
  • No behavior change for videos already on decoims.com or other CDNs

Made with Cursor


Summary by cubic

Rewrites VTEX product video URLs from assets.decocache.com and data.decoassets.com to decoims.com in toProduct so contentUrl uses the right CDN. Prevents Azion proxy requests on PDP loads and leaves existing decoims.com or other CDN URLs unchanged.

Written for commit 2721e33. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Video links are now normalized to use the correct asset host, improving playback consistency for product videos.
    • URLs from older asset domains are automatically rewritten to the current media domain instead of being left unchanged.

Product videos stored in the VTEX catalog may reference legacy CDN domains
(assets.decocache.com or data.decoassets.com). Rewrite them at transform
time so all VideoObject.contentUrl fields point to decoims.com.

This fixes Azion proxy requests generated by PDP pages across all VTEX sites.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b4a5bb71-7e90-42bc-b8d9-1b3fa12ab708

📥 Commits

Reviewing files that changed from the base of the PR and between cc04882 and 2721e33.

📒 Files selected for processing (1)
  • vtex/utils/transform.ts

📝 Walkthrough

Walkthrough

In vtex/utils/transform.ts, video URL strings in toProduct are now normalized using a regex replacement that rewrites URLs matching assets.deco(cache|assets).com or data.decoassets...com hosts to https://decoims.com/ before constructing the VideoObject.

Changes

Video URL normalization

Layer / File(s) Summary
Video URL rewrite in toProduct
vtex/utils/transform.ts
finalVideos applies a regex replacement to rewrite asset host URLs (assets.deco*.com) to https://decoims.com/ before emitting VideoObject entries.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A bunny hopped through video land,
Where URLs were out of hand.
With one small regex, swift and neat,
The asset hosts now re-complete —
To decoims they all now meet! 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, but it does not follow the repo template and is missing the Issue Link, Loom Video, and Demonstration Link sections. Rewrite the description to use the required headings and add the issue link, Loom video, and demonstration link.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the PR’s main change: rewriting legacy VTEX video URLs to decoims.com.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rewrite-legacy-video-urls

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 0.158.10 update
  • 🎉 for Minor 0.159.0 update
  • 🚀 for Major 1.0.0 update

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

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.

1 participant