Skip to content

Studio: avoid redundant texture list requests - #7607

Open
Gevroska wants to merge 1 commit into
ItsNotRexed:mainfrom
Gevroska:fix/studio-texture-list-requests
Open

Gevroska wants to merge 1 commit into
ItsNotRexed:mainfrom
Gevroska:fix/studio-texture-list-requests

Conversation

@Gevroska

@Gevroska Gevroska commented Nov 23, 2026 •

Copy link
Copy Markdown

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/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.
  • node --test tests/test_viewer_streaming.cjs tests/test_viewer_studio.cjs — 67 passed and one existing camera-speed test failed because its VM lacked AbortController. 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 tests and python -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 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.

AI-assisted: yes (Codex).

Checklist

  • No game data, keys or decryption.

@airp1ane

Copy link
Copy Markdown
Contributor

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.

AI-assisted.

@kapitche

Copy link
Copy Markdown
Contributor

Tested c6c0ca1 merged with main dde82f2 on Linux/Node v22.23.5 (not Python: the PR changes viewer/studio.html and a .cjs test): pass

Merge into main was clean.

Commands run in the merged worktree:

  • node --test tests/test_viewer_studio.cjs: 11 tests, 11 pass, 0 fail.

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.

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.

3 participants