mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #651] viewer: reset chunk download deadline while body bytes stream (VIEWER-CHUNK-IDLE-TIMEOUT) #690
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#690
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/651
Author: @kirigayakazima
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/viewer-chunk-idle-timeout📝 Commits (1)
5e19f48viewer: reset chunk download deadline while body bytes stream (VIEWER-CHUNK-IDLE-TIMEOUT)📊 Changes
2 files changed (+252 additions, -7 deletions)
View changed files
📝
tests/test_viewer_streaming.cjs(+173 -4)📝
viewer/index.html(+79 -3)📄 Description
Claimed in the coordination issue as: VIEWER-CHUNK-IDLE-TIMEOUT (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129434586)
What and why
Follows up on @slauko's finding in #14 (comment 7128949696), where valid multi-hundred-megabyte clay chunks (up to 773 MB) hit
CHUNK_DOWNLOAD_TIMEOUT_MS(30 s) on a cold read because the timer bounded the entire download wall-clock duration rather than idle stalls.viewer/index.html: addparseContentLength/readChunkBytessoloadChunkstreams chunks viaresponse.body.getReader()and resets the 30 s deadline whenever non-empty body bytes arrive:Uint8Array(capped at 1 GiB) when an uncompressedContent-Lengthis valid, spilling gracefully if more bytes arrive or slicing if the stream ends early; omits preallocation whenContent-Encodingis set.AbortSignalabort and releases the lock infinally.response.arrayBuffer()whenresponse.body?.getReaderis absent.tests/test_viewer_streaming.cjs: extend the mockfetch/GLTFLoaderfixture withstreamHeadersandparsesand add 5 unit test groups covering sliding idle timeouts (with and withoutContent-Length), headers-only stalls, empty-chunk stalls,Content-Lengthmismatches /Content-Encoding, and mid-transfer cancellation/drop cleanup.Tested
On Windows 11 x64 (Node v24.19.0, Python 3.14.7) at $sha, synthetic fixtures only (no game data):
node --test tests/test_viewer_streaming.cjs— 67 passed, 0 failed (includes 5 new streamed-timeout / assembly tests)node --test tests/test_viewer_studio.cjs— 11 passed, 0 failedpython -I tests/test_viewer_cdn_integrity.py— 10 ran, OKpython -I tests/test_viewer_serve.py— 39 ran, OK (1 skipped)python -I tests/test_ci_registration.py— 15 ran, OKpython -I tests/test_text_write_line_endings.py— 3 ran, OKpython -I tests/test_check_no_game_data.py&python -I scripts/check_no_game_data.py— exit 0python -m compileall -q make_game.py tools tests— exit 0GPUs tested: n/a
AI-assisted: yes
Checklist
21625bca) and merges cleanly (a conflicting pull request is labeledeeds rebase).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.