Commit Graph

22 Commits

Author SHA1 Message Date
Zach Clendenen
21c5b65d17 fix(streaming): address Greptile review of the RetroArch core override
- Retry the exit once when a broker boots the wrong core and the first exit
  fails: the broker refuses every activate while that game runs, and the
  released claim leaves nothing behind to stop it.
- Stamp the launch's core tier on the session and report it through the
  status poll, so a tab that missed launch-ready still warns about an
  untested or broken core, once.
- Translate the core-untested and core-blocked warnings in every locale.
2026-09-27 16:41:38 -05:00
Zach Clendenen
8336f127b6 refactor(streaming): simplify pass on the RetroArch core override 2026-09-27 14:39:13 -05:00
Zach Clendenen
2d25618ee2 fix(streaming): code-review pass on the RetroArch core override 2026-09-27 14:29:47 -05:00
Zach Clendenen
cd813caeba fix(streaming): tighten core override edge cases from review 2026-09-27 09:49:31 -05:00
Zach Clendenen
9f00d757a8 fix(streaming): don't hydrate default-core states into another RetroArch core 2026-09-27 09:49:13 -05:00
Zach Clendenen
007fb90e53 feat(streaming): warn the player when the RetroArch core is untested or known broken 2026-09-27 09:49:08 -05:00
Zach Clendenen
9ade9dfdb8 simplify(pr-ready step 3): collapse duplicated branches and dead code
- config: one _keys_by_label grouping serves both the unique-label map
  and the shared-label warning.
- claim_session: one abort-and-raise for either refused pick; the
  newest-save lookup is a single conditional expression.
- launch: pick refusal fields off one optional ImportRefusedError.
- imports: skip_state is always true for a foreign save archive; drop an
  unreachable KeyError and the unused str form of _read_member.
- webstation: ImportSpec.state_channel is a Literal.
- Stream.vue: the 400 refusal hint folds into the generic server branch;
  pickableStates drops a guard nativeStreamStates already has.
2026-09-25 19:20:30 -05:00
Georges-Antoine Assi
8f7d092d67 simplify(pr-ready step 3): one refusal type, one resume-import value, one zip staging loop
- build ImportRefusalSchema directly in the broker, dropping the mirror dataclass and the asdict conversion
- replace the resume_via_import/resume_needs_import pair with one ResumeImport literal
- stage base and foreign zips through a shared helper, parse each member once, and read the base only when something is imported
- ImportSpec.kinds is a set of names, and a successful import-spec answer is cached briefly so one claim asks once
- show the suggested emulator's display name in the refusal hint
- trim long comments and the dangling spec reference

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 11:43:08 -04:00
Georges-Antoine Assi
eaea7e6db1 review(pr-ready step 2): decide import eligibility on the won container and release the claim on refusal
- recheck import-spec right after the win; refuse a foreign save/state the won broker will not import instead of sending it natively
- only route an older native exit state through the import archive when the broker takes archive-channel states
- withhold resume_slot from activate when the import was lost
- import_spec: webstation-only, ACK timeout, catch http.client errors
- keep a foreign archive's own state out of a save import; preserve member timestamps and modes
- fix cs_CZ/pl_PL plural forms, a stale picker comment, and change-history docstrings

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 11:33:48 -04:00
Georges-Antoine Assi
4348c1e63d Merge remote-tracking branch 'origin/master' into streaming-patches-6
# Conflicts:
#	backend/handler/streaming/launch.py
#	backend/tests/endpoints/test_streaming.py
#	frontend/src/services/api/streaming.ts
2026-09-25 10:50:24 -04:00
Georges-Antoine Assi
d99c3c5f7b fix(streaming): report a failed archive resume, stop duplicate stream entry, and fold emulator case in core checks (code-review)
- Exit-state emulators with no uploaded archive no longer send a resume slot or report resume=true.
- isCoreCompatible compares emulator ids case-insensitively, like grouping and labels.
- launch-ready skips enterStream when a status poll already entered the stream.
- A Desktop heartbeat answered after a release no longer overwrites the exited state.
- Drop the notice_in_scope alias, reuse session_is_desktop, trim over-long comments.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 17:43:30 -04:00
Zach Clendenen
1960cd20be fix(streaming): budget import archive expansion, route non-newest resume picks through import, and stop shipping console.warn (Greptile) 2026-09-22 08:13:54 -05:00
Zach Clendenen
79139296dd simplify(pr-ready step 3): unify hydration result types, dedupe import-spec fetch, and drop redundant private wrappers 2026-09-22 07:12:57 -05:00
Zach Clendenen
c2a69d544b review(pr-ready step 2): sanitize broker refusal payloads, dedupe import archive members, and recheck save import eligibility against the won container 2026-09-22 07:12:57 -05:00
Zach Clendenen
068bb9bce1 fix(streaming): surface the refusal truncation count, fall through failed foreign reads, and log malformed import-spec replies 2026-09-22 07:12:57 -05:00
Zach Clendenen
e571d9a60b feat(streaming): skip the ordinary state push when resuming through an import 2026-09-22 07:12:57 -05:00
Zach Clendenen
0e301289b5 feat(streaming): surface an import refusal's structured detail to the player 2026-09-22 07:12:57 -05:00
Zach Clendenen
9e713d4058 feat(streaming): send a ROM's identity triple on webstation activate 2026-09-22 07:12:57 -05:00
Zach Clendenen
19793bd3f2 fix(streaming): resolve DuckStation and RPCS3 exit states and resume them from the save archive instead of pushing a state file 2026-09-18 22:36:33 -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
010e0fba4a fix(streaming): let a tab that missed launch-ready find its way in
The room URL only ever existed in the launch-ready push, so a socket that
dropped while the game was coming up left the tab loading forever over a
session that was running, with no way out but a release.

The session now records the room the launch answered with, the status poll
reports it along with the container it was found on, and a loading tab enters
the stream on that answer.
2026-09-17 15:36:05 -05:00
Georges-Antoine Assi
f78348da0f refactor(streaming): move the endpoint's domain layer into handler/streaming
endpoints/streaming.py had grown to 3778 lines, but only about a third of
that was routes. The rest was a second copy of the layer handler/streaming
already exists to hold: broker verbs, webstation protocol translation,
state and save and memory-card transfer, session teardown.

Split it along those seams rather than by route, and give claim_session
the same treatment: its 406 lines are now four named phases.

Cross-module calls go through the module (states.pull_state_to_library,
commands.stop) instead of imported names, so one definition site is what
tests patch and what every caller reads.

No route path, scope or response model changed, so the OpenAPI schema is
untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 18:47:18 -04:00