Commit Graph
12562 Commits
Author SHA1 Message Date
Zach Clendenen 5ccafb361d refactor(streaming): drain spawned tasks in the job runner for every task, build the abandoned read on the live one, and drop the reaper's extra config parse (simplify) 2026-09-18 16:37:05 -05:00
Zach Clendenen ca4ba4ee9a fix(streaming): keep a reap going past one failing container, give it the hold ceiling, keep no per-minute history, and share the abandoned-session read (code-review) 2026-09-18 16:28:02 -05:00
Zach Clendenen 9ee6bd4950 feat(streaming): reap abandoned streaming sessions every minute
A session whose heartbeat went stale was only torn down when a new claim
found every container of its platform held, so a player who left without
the pagehide release landing kept the emulator running. A scheduled task
now sweeps every configured container and hands stale sessions to the
existing abandoned-session teardown, which is made public for it.
2026-09-18 16:28:02 -05:00
Zach Clendenen 903bb35142 fix(streaming): bind the in-session controls to their claim, move the claim resolver into access, and translate the new strings (Greptile review)
Volume, mute, save-state, load-state and swap-disc now carry the claim's container and stamp, so a replaced tab or a second pool tab cannot drive another session. The claim resolver moves from the endpoint into handler/streaming/access.py, and the draining and occupied strings get real translations in every locale.
2026-09-18 16:15:17 -05:00
Zach Clendenen 8e92711a29 docs(streaming): trim the joinable_session_rom docstring to two lines (review-polish) 2026-09-18 14:45:37 -05:00
Zach Clendenen e822ffa559 refactor(streaming): share the claim and emulator-key helpers, drop per-caller null conversions, and skip the ROM lookup for unjoinable sessions (simplify)
One forgetClaim/enterStream path in Stream.vue, one emulatorKey/emulatorLabelFrom home, the heartbeat compare-and-set via same_claim, and test helpers for drains, stubbed stops, deferred claims and 409s.
2026-09-18 14:41:25 -05:00
Zach Clendenen da88cdc72e fix(streaming): hand back a claim that lands after the player left, match the platform on a named join, and label only own emulator keys (code-review)
Leaving mid-claim unmounts the view, so a 202 held by the save-pull wait landed with nothing left to release it. A named join now applies the same platform check as the unnamed walk, emulatorLabel ignores prototype members, and the busy-pool 409 reads its snapshots concurrently.
2026-09-18 14:23:32 -05:00
Zach Clendenen e90d3897ca test(streaming): pin the claim each release names on Stop, a failed save, and a loading close
These three releases carried the stamp with no test behind them, so dropping it passed CI while freeing whatever claim now held the container.
2026-09-18 14:05:52 -05:00
Zach Clendenen 73c493f894 fix(streaming): report only the ended notice of the claim a poll names
A desktop re-claim leaves the last claim's notice in place, and a pool can hold one per container, so a stamped poll or heartbeat could show another claim's ended-by and reason.
2026-09-18 13:46:51 -05:00
Zach Clendenen 80b79b3bd8 test(streaming): run the real save-and-exit when checking how a pull settles
The route tests mocked save_and_exit with a ready-made settled flag, so nothing exercised the saved-and-waited rule that decides it.
2026-09-18 13:44:43 -05:00
Zach Clendenen 30ac6633f4 fix(streaming): end a launch whose claim ended before the 202 landed
Until the 202 names the claim, a session-ended notice cannot be matched to it, so notices that arrive in flight are held and the one naming the claim is replayed.
2026-09-18 13:29:15 -05:00
Zach Clendenen 78922d1a5d fix(streaming): act only on notices and polls about the claim a tab holds
A re-claim of the same container keeps its key, so a session-ended notice or a status reply for the replaced claim ended the one that took its place. A poll with no stamp yet could also enter another tab's room once its reply landed after the 202.
2026-09-18 13:23:34 -05:00
Zach Clendenen 6ebc323ac2 fix(streaming): name the ended claim's stamp in a termination notice
A re-claim of the same container keeps its key, so the container alone cannot tell the tab that lost its claim from the tab holding the next one.
2026-09-18 13:21:12 -05:00
Zach Clendenen eaf1ee3c6f fix(streaming): settle a webstation save-and-exit pull on any exit answer
The exit writes the save dump before it answers, so an answer without a state is as final as one with. The broker's outcome now says whether it settled, and the no-change release test covers only the answered case, which is what its name says.
2026-09-18 13:16:52 -05:00
Zach Clendenen 64bc6687f0 docs(streaming): say a draining container is shutting down on the player
A drain covers every teardown, not only a save pull, so the player's note on the 409 should not promise exit state is being collected.
2026-09-18 13:05:32 -05:00
Zach Clendenen e9e921063b fix(streaming): keep the Chinese translation of the draining notice
The shutting-down rewording replaced the existing zh_CN translation with English; reword it in Chinese instead.
2026-09-18 13:05:32 -05:00
Zach Clendenen a483966275 fix(streaming): tell a refused claim the container is shutting down, not saving
A drain covers every teardown, including a desktop release that never saves, so the 409 message and the desktop claim's note on it claimed a save that may not be running.
2026-09-18 13:04:55 -05:00
Zach Clendenen 3ccf731958 test(streaming): re-claim the container before polling with the replaced stamp
The test named a claim re-taken on the same container but only sent an invented stamp, so it now takes the container back and polls with the first claim's stamp.
2026-09-18 13:01:13 -05:00
Zach Clendenen 6cb9bbe299 docs(streaming): wrap the status route's claimed_at line
It ran past the 88 columns the file's other docstrings wrap at.
2026-09-18 13:01:13 -05:00
Zach Clendenen 8f44b0808c refactor(streaming): recover a missed launch-ready off the stamp alone
The status poll carries the claim's stamp once the 202 lands, so it can only report this tab's own session and the container it echoed back had nothing left to check.
2026-09-18 13:00:21 -05:00
Zach Clendenen 65ea8da612 fix(streaming): enter only the launch of the claim this tab holds
A tab that missed its launch-failed keeps its container, so a second tab's re-claim of that container would otherwise hand it the other tab's room.
2026-09-18 12:58:08 -05:00
Zach Clendenen be68050f3f fix(streaming): stamp the launch pushes with the claim they belong to
With one container per platform a second tab re-claims the same container, so the container alone cannot tell a tab its own launch-ready from the claim that replaced it.
2026-09-18 12:56:30 -05:00
Zach Clendenen e4548b771c fix(streaming): keep retrying a webstation exit pull the exit never confirmed
A webstation exit that timed out or failed may still be writing its save dump, so taking its first answer as final could leave the archive uncollected. The stop now reports whether the broker answered, and only an answered exit or a confirmed save-and-exit takes one fetch. The claim test now makes a real claim while the pull runs.
2026-09-18 12:53:20 -05:00
Zach Clendenen 3400ba77aa fix(streaming): tell a refused player the container is shutting down, not saving
The drain marker covers every teardown, including a desktop release and an exit without saving, so the busy notice on the player and desktop claimed a save that may not be running.
2026-09-18 12:37:47 -05:00
Zach Clendenen 395b051ed3 fix(streaming): offer an emulator configured in another case once
The upload core picker deduped states' emulators by the raw id, so play and Play were two options both labelled Play! though the backend treats them as one emulator.
2026-09-18 12:37:47 -05:00
Zach Clendenen f1ee827851 fix(streaming): group an emulator configured in another case with its own
The backend matches a save's emulator case-insensitively, so states tagged Play and play belong to one emulator, but the strip split them into two groups both headed Play!.
2026-09-18 12:37:47 -05:00
Zach Clendenen 35edbd7435 refactor(streaming): share the ended-reason block between player and desktop
Both views drew the same labelled reason with copied markup and styles, so a change to one would drift from the other.
2026-09-18 12:29:50 -05:00
Zach Clendenen 35761aa85c refactor(streaming): type a claim's 409 detail in one place
The player and the desktop each spelled the busy-container detail inline, and the two copies had already drifted.
2026-09-18 12:27:43 -05:00
Zach Clendenen 983ecc01c6 fix(streaming): ship the occupied-by desktop error in English everywhere
Untranslated streaming strings on this branch ship as the English text so translators pick them up in one pass, like the neighbouring desktop-error-occupied.
2026-09-18 12:25:59 -05:00
Zach Clendenen bfa160a858 fix(streaming): stamp the status poll a loading tab recovers from
A second tab of the same user re-claims the same container when there is only one, so a container check alone let a loading tab adopt that tab's room.
2026-09-18 12:25:47 -05:00
Zach Clendenen 9adc555a34 fix(streaming): let the status poll name the claim it was given
With one container per platform a second tab re-claims the same container, so only the stamp tells a loading tab that the running session is no longer its own.
2026-09-18 12:24:45 -05:00
Zach Clendenen 0c5e536889 fix(streaming): stop storing a desktop's room no route reads
The desktop view takes its room from the claim POST and re-claims on reload, and the status poll never answers for a desktop, so the stored room was a dead write.
2026-09-18 12:23:05 -05:00
Zach Clendenen 765fce8add docs(streaming): say a heartbeat names any desktop it beats
The previous wording read as a desktop outside the first pool, when every desktop needs its container named.
2026-09-18 12:18:26 -05:00
Zach Clendenen 23136848e8 fix(streaming): name the route a replaced claim's call was ignored on
Release and save-and-exit share the lookup that logs a replaced claim, so the line has to say which route it ignored.
2026-09-18 12:18:24 -05:00
Zach Clendenen 7502608ab1 fix(streaming): let an unnamed stamped release of a taken-over claim be a no-op
Without a container, the lookup raised 403 when another player held the platform's only session, before the stamp check could read the takeover as a gone claim. A stamped call now treats any failed lookup as that claim being gone, as the named path does.
2026-09-18 12:18:05 -05:00
Zach Clendenen 99b44b52fa fix(streaming): keep a named save-and-exit to a game of its platform
Save-and-exit went through the release route's resolution, which ends whatever a named container holds, so naming a shared container could save and kill a desktop or another platform's game. A release still ends anything named; save-and-exit now matches only a game of the path's platform.
2026-09-18 12:17:01 -05:00
Zach Clendenen 507a91855e test(streaming): give the claim-behind-an-exit test distinct user and ROM ids
A fresh database can hand the admin and the ROM the same id, and then a claim that swapped them would still wait on the exit's key.
2026-09-18 12:13:15 -05:00
Zach Clendenen a62d1158ad fix(streaming): keep retrying a save pull the broker has not confirmed finished
A per-emulator broker acks DELETE /launch before the emulator has flushed its saves, and a blocking save-and-exit that timed out or failed may still be killing it, so one answer from those pulls could miss the session's saves. Only a webstation exit, which answers once its dump is written, and a confirmed blocking save-and-exit take the first answer as final.
2026-09-18 12:13:11 -05:00
Zach Clendenen 11eabe6431 docs(streaming): fit the branch's comments and docstrings in two lines
The repo caps a comment at two lines and a docstring at one sentence plus Args and Returns. Several comments and docstrings this branch wrote or edited ran to three lines or more, so they are tightened, with parameter notes moved under Args.
2026-09-18 12:03:10 -05:00
Zach Clendenen 0743e456a6 fix(streaming): call a draining container shut down, not saving
The backend holds the drain marker through every teardown, including a desktop release and an exit without saving, so the admin panel told an admin a save was running when none was.
2026-09-18 11:54:09 -05:00
Zach Clendenen 5d29bdea3f test(streaming): render the real settings section in the streaming tests
The stub was justified by an auto-stub that mount never applies, and the real section already renders both slots the tests read.
2026-09-18 11:53:32 -05:00
Zach Clendenen afd2a6e3ef fix(streaming): label a state's emulator in the upload core picker
The picker showed a streamed state's raw emulator id, such as play, while every other surface naming that emulator shows its display name.
2026-09-18 11:52:58 -05:00
Zach Clendenen 437de2866a test(streaming): share one emulatorLabel stand-in across the asset tests
Six test files carried their own copy of the fake label map, which could drift apart from each other and from the store's lookup.
2026-09-18 11:52:00 -05:00
Zach Clendenen ff395008a4 fix(streaming): label an emulator configured in another case
The backend keys its display names in lowercase and lowercases the id before looking it up, while the store looked up the raw id, so a mixed-case configured emulator got its name on the Play button and its raw id on save chips.
2026-09-18 11:50:59 -05:00
Zach Clendenen c7dc5ea918 fix(streaming): name the game holding a container the desktop was refused
The desktop claim's 409 carries the rom_name of the session in the way, as a game claim's does, and the desktop showed only a generic in-use message while its test claimed to name the game. The test's i18n mock now keeps params so the name is asserted.
2026-09-18 11:47:11 -05:00
Zach Clendenen 7177ca3181 test(streaming): keep playing through another container's ended notice
The test never sent launch-ready, so it asserted a loading tab under a name that promises a running game.
2026-09-18 11:45:17 -05:00
Zach Clendenen 5791f23f54 test(streaming): unmount every Stream view a test mounts
Views left mounted answered the next test's visibilitychange, so the recovery test's status poll assertion held whether or not the view under test polled. It now asserts a single poll.
2026-09-18 11:44:27 -05:00
Zach Clendenen ce126fe440 docs(streaming): say who names the container on a release route
The holder's own release now names the container it claimed, so the docstring no longer describes an admin as the only caller that sends one.
2026-09-18 11:42:57 -05:00
Zach Clendenen 6a726f2c93 docs(streaming): say who names the container on a release
The player's own release, heartbeat and unload paths now name the container they claimed, so it is no longer only an admin ending someone else's session that sends it.
2026-09-18 11:42:38 -05:00
Zach Clendenen 144bd2a5de fix(streaming): show the reason a desktop's session was ended
The ended notice carries the reason given, which the game view shows under its headline and the desktop dropped, leaving its comment to promise a reason the admin never saw.
2026-09-18 11:42:17 -05:00