You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Studio: avoid redundant texture list requests - #7607
Depends on: #7063 for the existing camera-speed test failure in viewer CI.
What and why
Opening Studio's texture tab again could start another /api/textures request while the first was pending. Reopening the tab after a successful empty result also fetched the list again. Keep one request in flight, reuse a successful list for the rest of the page session, and retry on the next tab visit after a failed request.
Tested
Windows, Node.js 24.22.3, Python 3.13.3. CPU-only, no GPU or driver used.
node --test tests/test_viewer_studio.cjs — 11 passed. Both new cases failed before the fix.
python -I scripts/run_semantic_tests.py tests/semantic -j 8 — 5,894 tests across 445 files, with failures in 22 files. The checkout advanced between two upstream revisions during this ancillary run, so the result does not qualify either revision individually. A later run with the missing synthetic shader fixture directories present ran 5,956 tests across 447 files on upstream base dde82f27. The two remaining failing files were test_image_atomics_guard and test_image_store_d16, both covered by tests/semantic: three image test files red on main (stale after #4473 and #6805; LLVM_MC on Windows) #7284.
Tested \c6c0ca146\ on Windows 11, Node v26.13.1, Python 3.15.2 (CPU-only checks, no GPU/game files needed): pass.
ode --test tests/test_viewer_studio.cjs: 11/11 pass (both new texture-tab tests pass).
ode --test tests/test_viewer_streaming.cjs: 56/57 pass (the 1 failure is the pre-existing \AbortController is not defined\ in the camera-speed test on \main, unrelated to this PR).
Negative control (reverting \�iewer/studio.html\ to \main\ \7ef2fdd46): 9/11 pass, both new tests fail as expected (duplicate /api/textures\ fetch and unguarded HTTP 503).
Merge check onto \main\ \7ef2fdd46\ (\git merge-tree), \git diff --check, and \scripts/check_no_game_data.py: all clean.
Negative control: git checkout upstream/main -- viewer/studio.html, then node --test tests/test_viewer_studio.cjs: 11 tests, 9 pass, 2 fail (both new tests: "reopening the texture tab reuses an in-flight request and a successful empty list" and "reopening the texture tab retries a failed request"). Restored with git checkout HEAD -- viewer/studio.html.
Diff read: loadTextures is guarded by textureListStatus (idle / loading / loaded), is set back to idle on a non-ok response or a thrown error so the next tab open retries, and switchTab now calls it unconditionally instead of checking allTextures.length.
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
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.
Claimed in coordination issue #7496.
Depends on: #7063 for the existing camera-speed test failure in viewer CI.
What and why
Opening Studio's texture tab again could start another
/api/texturesrequest while the first was pending. Reopening the tab after a successful empty result also fetched the list again. Keep one request in flight, reuse a successful list for the rest of the page session, and retry on the next tab visit after a failed request.Tested
Windows, Node.js 24.22.3, Python 3.13.3. CPU-only, no GPU or driver used.
node --test tests/test_viewer_studio.cjs— 11 passed. Both new cases failed before the fix.node --test tests/test_viewer_streaming.cjs tests/test_viewer_studio.cjs— 67 passed and one existing camera-speed test failed because its VM lackedAbortController. All 68 passed in a scratch copy with the test fix from test_viewer_streaming: fix the false failure in the Shift-camera sandbox (missing AbortController) #7063.python -I tests/test_viewer_serve.py— 37 passed, 2 skipped.python -I tests/test_gallery.py— 24 passed, 2 skipped.python -I -m compileall -q make_game.py tools testsandpython -I scripts/check_no_game_data.py viewer/studio.html tests/test_viewer_studio.cjs— passed.python -I scripts/run_semantic_tests.py tests/semantic -j 8— 5,894 tests across 445 files, with failures in 22 files. The checkout advanced between two upstream revisions during this ancillary run, so the result does not qualify either revision individually. A later run with the missing synthetic shader fixture directories present ran 5,956 tests across 447 files on upstream basedde82f27. The two remaining failing files weretest_image_atomics_guardandtest_image_store_d16, both covered by tests/semantic: three image test files red on main (stale after #4473 and #6805; LLVM_MC on Windows) #7284.AI-assisted: yes (Codex).
Checklist