Skip to content

Fix stale ViewerAsset capability URL in LLViewerAssetStorage on region teleports - #366

Open
Shadowolf7 wants to merge 1 commit into
AlchemyViewer:developfrom
Shadowolf7:upstream-fix/viewer-asset-storage-stale-url
Open

Fix stale ViewerAsset capability URL in LLViewerAssetStorage on region teleports#366
Shadowolf7 wants to merge 1 commit into
AlchemyViewer:developfrom
Shadowolf7:upstream-fix/viewer-asset-storage-stale-url

Conversation

@Shadowolf7

Copy link
Copy Markdown

Summary

  • In LLViewerAssetStorage, mViewerAssetUrl was cached as a member variable with an if (mViewerAssetUrl.empty()) check.
  • When an agent teleports between simulator regions, mViewerAssetUrl remained populated with the previous region's capability URL and was not updated to the new region's ViewerAsset capability.
  • Consequently, initial GLTF material downloads (AT_MATERIAL) and generic asset requests in the new region were sent using the old region's capability URL or direct unauthenticated CDN endpoints, failing with 403 Forbidden / missing asset errors.
  • This patch removes the stale mViewerAssetUrl member and dynamically queries gAgent.getRegion()->getViewerAssetUrl() for every request in assetRequestCoro, matching the behavior of LLMeshRepository and LLTextureFetch.

@coderabbitai

coderabbitai Bot commented Aug 21, 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 884d2eec-84cd-4cda-a881-299b973d3b1d

📥 Commits

Reviewing files that changed from the base of the PR and between 330667d and 4164d4f.

📒 Files selected for processing (2)
  • indra/newview/llviewerassetstorage.cpp
  • indra/newview/llviewerassetstorage.h
💤 Files with no reviewable changes (1)
  • indra/newview/llviewerassetstorage.h

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved asset request handling by using the current region’s asset service URL.
    • Requests now fail cleanly when no valid asset service URL is available, preventing invalid requests.

Walkthrough

LLViewerAssetStorage no longer stores a persistent viewer asset URL. Asset requests retrieve the current region URL locally, validate it, and return LL_ERR_NO_CAP when it is unavailable.

Changes

Viewer asset URL resolution

Layer / File(s) Summary
Local viewer asset URL resolution
indra/newview/llviewerassetstorage.cpp, indra/newview/llviewerassetstorage.h
The persistent mViewerAssetUrl member and capability assignment are removed. Asset requests retrieve and validate the current region URL before building the request URL. Missing URLs trigger LL_ERR_NO_CAP callbacks.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🔵 Low · up to 4164d

During a region teleport, asset requests may briefly fail if the new region has not finished providing its capability URL when the request resumes. The change is otherwise mergeable with explicit owner awareness and follow-up to recheck capability readiness after region changes.

Poem

A rabbit checks the region gate,
Finds the asset URL up to date.
No stale cache sits in the way,
Missing caps end the request that day.
Hop, hop—clean paths now lead the way!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the bug and the fix, but it omits the required issue link, checklist, testing details, and additional notes sections. Use the repository template and add the related issue, completed checklist, testing results, and any relevant additional notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the stale ViewerAsset capability URL issue and its occurrence after region teleports.
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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant