Skip to content

feat: fetch scene files from asset bundle CDN instead of catalyst#7833

Open
decentraland-bot wants to merge 7 commits intodevfrom
fix/7625-cdn-scene-files
Open

feat: fetch scene files from asset bundle CDN instead of catalyst#7833
decentraland-bot wants to merge 7 commits intodevfrom
fix/7625-cdn-scene-files

Conversation

@decentraland-bot
Copy link
Copy Markdown

@decentraland-bot decentraland-bot commented Mar 26, 2026

Pull Request Description

What does this PR change?

Extends CDN redirection to cover all three scene files (index.js, scene.json, main.crdt) instead of just index.js. Before using CDN URLs, performs parallel HEAD requests to validate all three files exist on the CDN. If any file is missing, falls back entirely to catalyst (all-or-nothing strategy). Also simplifies LoadMainCrdtAsync — CDN resolution is now handled uniformly by SceneHashedContentWithCDN.

Scenes marked as fallback could fail to load because files were missing from the catalyst. Routing requests to the CDN — where the asset-bundle-converter uploads them — eliminates this class of failure.

Addresses #7625

Test Instructions

Prerequisites

  • Use a build connected to a catalyst with scenes that have assetBundleManifestVersion set
  • Ensure network access to the asset bundle CDN

Test Steps

  1. Navigate to a scene with AB conversion complete
  2. Verify all three files (index.js, scene.json, main.crdt) are served from CDN (check logs)
  3. Navigate to a scene without assetBundleManifestVersion
  4. Verify it loads normally from catalyst
  5. Simulate a missing CDN file (e.g. conversion in progress)
  6. Verify full fallback to catalyst for all three files
  7. Check logs for HEAD request failures when CDN is unavailable

Additional Testing Notes

  • The fallback is all-or-nothing: if any of the three HEAD requests fail, all files come from catalyst
  • CDN URL pattern: {assetBundleURL}/{abVersion}/{entityId}/{fileName}

Quality Checklist

  • Changes have been tested locally
  • Documentation has been updated (if required)
  • Performance impact has been considered
  • For SDK features: Test scene is included

Code Review Reference

Please review our Code Review Standards before submitting.

🤖 Generated with Claude Code

…atalyst

When a scene has an asset bundle manifest version (i.e. it has been processed
by the asset-bundle-converter and is served from the registry), redirect
index.js and main.crdt downloads to the asset bundle CDN (S3) instead of
fetching them from the catalyst.

Changes:
- SceneHashedContentWithCDN: new ISceneContent decorator that overrides the
  URL for the main script (index.js) to point to the CDN.
- LoadSceneSystemLogic: returns SceneHashedContentWithCDN when the scene has
  an AB manifest, so the V8 runtime fetches index.js from the CDN.
- LoadSceneSystemLogicBase.LoadMainCrdtAsync: tries the CDN URL first for
  main.crdt, falls back to the catalyst URL on any error (e.g. conversion
  still in progress).

CDN URL pattern: {assetBundleURL}{abVersion}/{entityId}/{fileName}

This eliminates a class of incidents where a scene marked as fallback could
not load because its index.js or main.crdt files were missing from the
catalyst.

Closes #7625
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

@dalkia dalkia changed the title feat: fetch index.js and main.crdt from asset bundle CDN instead of catalyst feat: fetch scene files from asset bundle CDN instead of catalyst Mar 26, 2026
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.

2 participants