Commit Graph

2538 Commits

Author SHA1 Message Date
Georges-Antoine Assi
c6ffa3ca57 Merge remote-tracking branch 'origin/master' into feat/pinned-media
# Conflicts:
#	backend/tests/test_migrations.py
2026-09-26 12:45:12 -04:00
Sam Dornan
d1ce4e3db2 fix(sync): make deleted-save tracking exact, complete, and effective on filled slots (#4789) 2026-09-26 12:33:54 -04:00
Georges-Antoine Assi
aa01f05e23 Merge pull request #4767 from rommapp/claude/github-issue-4678-w41e12
fix(auth): rename seeded permission groups to Viewer and Editor
2026-09-26 11:05:59 -04:00
Georges-Antoine Assi
d946af0539 refactor(auth): replace is_system with system_key
is_system was true exactly when system_key is set, so 0137 now drops it
after backfilling the key, and downgrade rebuilds it from the key. The
group API returns system_key instead, and the admin UI reads it for the
system tag and edit warning.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:58:21 -04:00
Georges-Antoine Assi
4f31df90f0 fix(v2): apply code-review fixes to pinned media
Cap the default selection at the pin limit, settle writes on the live
rom_user, gate pin controls on roms.user.write, dedupe keys server-side,
store resets as SQL NULL, and reuse MediaShelfItem for artwork entries.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:45:41 -04:00
Georges-Antoine Assi
ead613e263 fix(auth): treat invalid bearer and basic credentials as unauthenticated
HybridAuthBackend runs inside Starlette's AuthenticationMiddleware, so an
HTTPException raised while validating a JWT bearer token (expired, bad
signature, garbage) or parsing a malformed Basic header bypassed FastAPI's
exception handlers and surfaced as a 500 on every endpoint, including
/api/heartbeat. Return None instead, matching the rmm_ client token path:
public endpoints respond normally and protected ones return 401.

Fixes #4788

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:43:36 -04:00
Georges-Antoine Assi
5cad653261 fix(auth): look up seeded permission groups by a stable system key
Tests, fixtures and the e2e seed found the seeded groups by display name,
which an admin can edit and this PR just changed. A unique system_key
column (viewer/editor), added and backfilled by 0137, identifies them
instead, and get_system_group() replaces the name lookups.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:42:44 -04:00
Georges-Antoine Assi
16a900eec7 Merge remote-tracking branch 'origin/master' into pr-ready/bb5d210 2026-09-26 10:21:48 -04:00
Georges-Antoine Assi
7840dd3a29 Merge remote-tracking branch 'origin/master' into feat/pinned-media
# Conflicts:
#	backend/endpoints/roms/__init__.py
#	backend/tests/test_migrations.py
2026-09-26 10:18:34 -04:00
Sam Dornan
c4f4d22687 chore(mypy): require coded ignores and flag stale ones, type protected_route (#4794) 2026-09-25 22:33:13 -04:00
Sam Dornan
2c71226887 ci: run mypy in its own workflow instead of through Trunk (#4724) 2026-09-25 21:37:01 -04:00
Sam Dornan
63cd9eb1b8 fix(backend): replace the legacy Query API with Select and type the session decorators (#4730) 2026-09-25 21:19:02 -04:00
Georges-Antoine Assi
939861094e Merge pull request #4691 from LoneAngelFayt/streaming-patches-6
feat(streaming): resume from a foreign emulator's save or state via declared import
2026-09-25 20:46:07 -04:00
Georges-Antoine Assi
274ef8b3af Merge pull request #4700 from rommapp/claude/netplay-auth
fix(security): authorize netplay rooms on ROM access
2026-09-25 20:27:32 -04:00
Zach Clendenen
c9f1d5e33b feat(streaming): offer only the foreign picks a broker imports, and honour the picked state over an older save's exit state
The streaming config now ships import_kinds per container, from the broker's
cached import-spec, so the picker hides foreign saves and states a broker would
refuse instead of failing them after the launch starts.

On DuckStation and RPCS3, a save pick other than the newest archive no longer
lets that archive's own exit state stand in for the picked state: the state
rides the import archive, or the resume is reported lost where the broker
cannot import it.
2026-09-25 12:53:04 -05:00
Sam Dornan
3a1f1f0e9c feat(sync): tell a device when the save it holds was deleted here (#4674)
* Tell a device when the save it holds was deleted here

Deleting a save took its row, its file and its device pairings, leaving nothing
that says it ever existed. A negotiation then read a client still holding the
save as a client with a save the server lacks, answered "upload", and the next
launch put the deleted save back. There was no way to say "this is gone": the
protocol's actions are upload, download, conflict and no_op.

So a slot emptied on purpose is now remembered. `deleted_saves` keeps one row
per (user, rom, slot) with what the slot held and when it was emptied, written
by the delete endpoint, which is the only place a deletion is the owner's
decision rather than housekeeping: autocleanup rotating a version out leaves
newer rows in the slot and is never recorded.

Negotiation reads it only when the slot has no row left, and answers the new
"delete" action when the client's copy is the one that went: the same content
hash, or a copy last written before the deletion. Anything written after it is
progress the server never held, so that still answers "upload" -- emptying a
slot is not a licence to delete a newer save.

The generated frontend models are hand-edited to match: this environment has
only CPython 3.14.0rc2, which the locked pydantic cannot import, so the backend
will not start for `npm run generate`. Both edits are mechanical (the new
literal in the union, the new count field), and `npm run typecheck` passes
against them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U

* Decide a deletion by identity, and record it before the row goes

Three real findings from the review, and the layering rule.

The record was written after the save row and its file were gone, with two
transactions and a filesystem removal between them. Anything failing in that
window left a deletion nothing remembered, which is the resurrection this
change exists to prevent. It is written first now: a record for a save that is
somehow still there is never read, because a negotiation only consults it when
the slot has no row left.

The client's copy was matched on its own timestamp against the server's
deletion time. Those clocks are not comparable, and a device running slow
would have been told to delete progress it made after the deletion. The match
is now identity alone: the slot remembers every version it lost, capped at the
twenty most recent, and a client holding any of them is told to drop it.
Anything else is offered back, which costs a deletion that does not reach that
device rather than a save that is gone.

Recording replaced the row with a delete and an insert, which two deletions of
the same slot could race into a uniqueness error. It locks the row and merges
into it, with the house savepoint-and-catch for the case where there is no row
yet to lock.

The comparison itself moves to handler/sync/comparison.py beside
compare_save_state, where the endpoint delegates to it and the rule is tested
on its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U

* Trim the new comments to the repo's rule

One or two lines each, with the rationale in the commit messages and the PR
description where the rule puts it. The model's docstring is one sentence, and
the comparison keeps its Args and Returns.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U

* Sort comparison imports

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U

* Widen the window a deletion is remembered in

A slot's record keeps a bounded list of the versions it lost, and the trim
drops the oldest, which are exactly the ones a long-offline device is
likeliest to still hold. At twenty, a device that missed twenty
delete-and-refill cycles of one slot comes back with a digest that has
aged out and is answered `upload`, which puts a deleted save back.

Raised to a hundred, where the device would have had to miss a hundred
manual deletions of the same slot. The residual is deliberate and cannot
be designed away by a longer list alone: past the bound the server does
not know those bytes were deleted, and the answer degrades to `upload`,
which fails by not propagating a deletion rather than by destroying a
save. A test now names that case so the next reader meets it as a choice
rather than as an oversight.

Found by Greptile on #4674.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U

* Trim the retention comments back to the rule

Both were over the two-line limit, and the constant's was a six-line
design essay of exactly the kind the last round of this review already
removed from this PR. The reasoning belongs in the commit that made the
change and in the pull request, where it is.

What stays is the part the code cannot say: the trim drops the oldest,
and past the bound a device is answered `upload` rather than `delete`.

Found by Greptile on #4674.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015B86R6sN9CZ2uAWXCB9Y3U

* Name the deletion record for assets, not only saves

Unreleased, so the table can take a name that states can share later
without another migration.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Apply code-review fixes to deletion records

Record a deletion in short separate transactions so concurrent first
deletions no longer deadlock on MariaDB, hash a save that never
recorded one, keep a re-deleted version from being trimmed, scope the
negotiation's read to emptied slots, and require total_delete.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Simplify deletion records

Drop the unread deleted_at column, record from _delete_save so every
caller of it is covered, skip a record no hash could ever match, let
comparison decide delete vs upload with its reason, count actions once,
and fold the near-duplicate tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Polish the deletion record's index comment

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-09-25 12:21:46 -05:00
Georges-Antoine Assi
4bcc9da844 refactor(netplay): apply simplify pass
- Move connect-time user resolution and login-session binding into
  SocketHandler.authenticate, shared by the /ws and netplay servers.
- Add SocketHandler.get_session and drop the per-module copies.
- Fold disconnect into leave-room, and the user load into the ROM gate.
- Read the room password only from the field EmulatorJS sends.
- Close both servers' sockets for a revoked session concurrently.
- Correct the join-room password rule in the architecture doc.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 13:03:08 -04:00
Georges-Antoine Assi
2af79c1486 fix(netplay): apply code-review xhigh findings
- Bind netplay sockets to their login session, keying the socket set per
  channel so revoking a session closes sockets on both servers.
- Read the room password from the top-level field EmulatorJS sends, and
  compare it in constant time.
- Namespace Socket.IO room names so a room id cannot collide with a sid.
- Refuse a duplicate player id on join, and leave the current room before
  opening or joining another.
- Coerce client-supplied maxPlayers and names, and store the resolved ROM id.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 12:50:37 -04:00
Georges-Antoine Assi
1cada9b7df Merge pull request #4720 from tmgast/feature/scan-title-ids
fix(scan): keep title-id settled file categories and report id-only changes on refresh
2026-09-25 11:58:34 -04:00
Georges-Antoine Assi
a18c8493c1 Merge remote-tracking branch 'origin/master' into streaming-patches-6
# Conflicts:
#	backend/endpoints/streaming.py
#	backend/tests/endpoints/test_streaming.py
2026-09-25 11:52:57 -04:00
Georges-Antoine Assi
fd7a6862a0 refactor(scan): drop the title-ids scan type in favor of the quick scan
A quick scan already re-reads the title id of every existing rom through
refresh_rom_files, so a dedicated scan type only added skips around it.
What stays is the refresh fix the rework surfaced:

- a reused row whose category extraction settled is now synced, where a
  quick scan used to drop it for want of a new, changed or removed row
- RomFilesRefresh.identity_changed, so an id-only change counts as updated
- the quick-scan info copy says it re-reads title ids

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 11:51:15 -04:00
Georges-Antoine Assi
b6dcfc6a3c polish(pr-ready step 4): trim comments and docstrings, keep the newest-state lookup off the event loop
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 11:48:16 -04:00
Georges-Antoine Assi
afa38d1df1 refactor(scan): run a title-ids scan through the quick-scan file refresh
A quick scan already re-reads the title id of every existing rom through
refresh_rom_files, keeping stored hashes for unchanged files. A title-ids
scan now takes the same branch instead of the full _identify_rom and
scan_rom path, which drops its special cases in _should_get_rom_files,
_should_extract_title_ids, _should_hash_incrementally, the resource
short-circuit, the scan_rom base-field list and the similarity guard.

refresh_rom_files gains what that path gave the scan:
- an opt-in embed_title_ids, so EMBED_SWITCH_TITLE_IDS still renames
- persisting a reused row whose category extraction settled, which a quick
  scan dropped before because only new, changed or removed rows were synced
- identity_changed on the result, so an id-only change counts as updated

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 11:45:50 -04: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
aa80073d34 feat(streaming): run exit save pulls on the streaming worker
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 11:34:05 -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
e35bcf11af Merge remote-tracking branch 'origin/master' into feature/scan-title-ids
# Conflicts:
#	backend/endpoints/sockets/scan.py
2026-09-25 10:50:50 -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
9131ac9f43 Merge remote-tracking branch 'origin/master' into streaming-reaper
# Conflicts:
#	backend/tasks/registry.py
2026-09-25 10:45:52 -04:00
Sam Dornan
7dd35aa139 fix(sync): give a sync session the life of one launch, and drop the dead play-session link (#4670) 2026-09-25 10:14:09 -04:00
Georges-Antoine Assi
e1052665c1 feat(streaming): run the session reaper on a streaming queue with a worker of its own
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 09:46:35 -04:00
Georges-Antoine Assi
22aa445d27 fix(streaming): hold the reaper off for a stale window after a restart, schedule it only with streaming on, and warn about later pools once across processes
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 09:29:48 -04:00
Georges-Antoine Assi
29e6b8c1e9 fix(streaming): keep a claim fresh through its setup, log what spawned work raised, and notify a task's success only after that work ends (code-review)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 08:40:50 -04:00
zurdi
51894eb5e7 chore(notifications): review-polish comments
pr-ready step 4: comments name no product as the actor, and the payload
helper's docstring says what it sends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 11:14:11 +02:00
zurdi
4205757e38 refactor(notifications): simplify pass; set URL-only services up from their URL
pr-ready step 3 (simplify), plus the dialog changes asked for while it ran.

- A service that gives out its own URL (Discord, Slack, ntfy...) is set up
  from that URL alone. The catalog lists the fields such a URL fills in
  (url_fields), and the dialog shows only what it lacks, such as Discord's
  bot name, which a URL read no longer wipes.
- Reading a URL checks that its fields rebuild the same URL, so a misread
  token is refused instead of saved.
- Bot name gets a translated label; "Advanced options" is a small text toggle.
- Simplify: compiled template patterns cached per service, one table of
  token patterns, parse_bool for flags, the log collector reordered, the
  paste state reset in one place, the About tooltip state as a list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 11:09:01 +02:00
zurdi
8c91187d9b fix(notifications): review fixes for URL pasting and the About tooltip (code review)
- The About tooltip measures truncation whenever its grid lays out, so
  it opens on the first hover or focus; RTooltip decides on the
  pointer's arrival, before a hover-time measurement had landed.
- A pasted URL naming a schema RomM leaves out is refused before Apprise
  builds its plugin.
- An empty reply no longer leaves a bare "Reply:" on the error, and the
  warnings Apprise logs outside a send reach the server log again.
- A parsed service missing from the dialog's catalog shows the paste
  error instead of its raw id, and URL fields are read in one loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 10:54:10 +02:00
zurdi
88631d0c53 feat(notifications): keep a pasted URL, show what it filled in, send the RomM icon
- The pasted URL stays in its field once the others are filled in; it
  goes when the dialog opens or another service is picked by hand.
- The field then says which fields the URL filled in, and those fields
  glow briefly (not with reduced motion).
- Apprise sends the RomM icon where a service shows the sender's
  picture, such as Discord's avatar, instead of Apprise's own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 10:45:22 +02:00
zurdi
ec239c7953 feat(notifications): read a pasted URL into an Apprise channel's fields
- Pasting a service's own URL (a Discord webhook's) or an Apprise URL
  in the channel dialog fills its fields in as soon as it's pasted, or
  says why it can't. POST /api/notification-channels/apprise-services/parse
  instantiates the plugin and matches the URL Apprise writes for it
  against the service's templates, so it works for every service; a new
  channel moves to the service the URL is for.
- A failed delivery's error carries the start of the service's reply
  after Apprise's warning, so a 400 says why (Discord refuses a bot name
  containing "discord"). Apprise's log stays out of the server log.
- Setup guides link Apprise's wiki instead of appriseit.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 10:41:04 +02:00
zurdi
29084cc593 chore(notifications): review polish for the Apprise channels
- Name what the helpers return: checked_fields gives back the fields to
  keep, _defuse_mentions breaks up pings.
- Declare AppriseFieldValue as an explicit TypeAlias, which mypy under
  trunk needs to use it in annotations.
- Trim the comments that restated a field list or defended a limit, fix
  the Apprise type's comment still describing a single URL, and split
  the dense channels paragraph in the architecture doc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 10:27:18 +02:00
zurdi
bcd9981c28 refactor(notifications): simplify the Apprise channels (simplify pass)
- Tell a moved destination by Apprise's own url_identifier, with the
  same secrets on both sides, instead of a hand-kept list of field
  names that missed region and instance fields.
- RComboboxField takes `rules` and reports to its RForm like RSelect,
  so a required list validates itself; the dialog's missing-list state
  and the prop threaded through two components go.
- The backend leaves default values out when it keeps the fields, so
  the form sends what it holds instead of mirroring each default.
- Load Apprise only when an Apprise channel delivers: the local schemas
  are left out of the catalog instead of disabled at import, so scans,
  tasks and webhook or email jobs no longer load every plugin.
- Look services and fields up by key, build a URL from the service it
  already has, merge the plugin helpers, and find the first fitting
  template instead of all of them.
- One create call for every channel type, assert_admin for the service
  catalog, the timeout wording in describe_error, the plain-text body
  shared with email through OutboundMessage.text, WebhookUrl back to
  its name.
- Reuse settings.username and settings.password for those field
  labels, an RBtn for the setup guide link, and load the catalog only
  when the dialog can show it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 10:04:23 +02:00
zurdi
61ec7986a3 fix(notifications): harden Apprise channels (security audit and code review)
- Leave FCM out of the catalog: its keyfile token makes Apprise open a
  local path or fetch a URL itself.
- Treat credential-named tokens as secrets even when Apprise doesn't
  (Mastodon, Misskey, Plivo, SMSEagle, LaMetric, Rocket.Chat, a JSON
  path), and hide any secret left in the masked target or in the
  errors that reach last_error and the logs.
- A secret left out of an edit keeps its value, an empty one removes it,
  and a kept secret no longer follows the channel to another host,
  port, schema, SMTP server or ntfy mode. The form offers "Remove it"
  for stored secrets and names them through `stored_secrets`.
- Break up @everyone, @here and <@…> so a notification pings nobody, as
  the removed Discord payload did.
- Keep only the fields the service takes, cap lists at 20 items, and
  accept only a hostname or address as a host.
- Give the channel test the same 60 s budget as a queued delivery, and
  build the service catalog response once per process.
- Don't require a stored secret list (Bark) again on edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 09:27:32 +02:00
zurdi
8089040bfd feat(notifications): rebuild notification channels on Apprise
Forward notifications to any of the 100+ services Apprise reaches instead
of the two hand-coded webhook formats. The channel form lists every
Apprise service with the fields it takes, and the backend builds the
Apprise URL from them.

- New `apprise` channel type, admin only: Apprise opens its own
  connections, past the SSRF guard. The owner's role is checked again at
  every delivery.
- GET /api/notification-channels/apprise-services describes each service
  from Apprise's plugin details: URL tokens as fields, options as
  advanced fields. A field is required only when every URL template
  needs it.
- A channel stores the service and its fields sealed; the URL is built
  from the template those fields fill at each send. Local schemas, the
  options that read files and the ones RomM sets are never offered.
  Apprise follows no redirects, does not retry and its timeouts are
  capped.
- The RomM JSON webhook keeps its payload and HMAC signature; its
  Discord and ntfy formats go, Apprise covers them. Email is unchanged.
- The v2 dialog picks the type from one searchable list and renders the
  service's fields, options folded under "Advanced options".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 09:01:39 +02:00
Georges-Antoine Assi
2fc0460670 Merge remote-tracking branch 'origin/master' into streaming-reaper
# Conflicts:
#	backend/tasks/registry.py
#	backend/tasks/tasks.py
#	backend/tests/tasks/test_tasks.py
#	docs/BACKEND_ARCHITECTURE.md
2026-09-24 21:52:08 -04:00
Georges-Antoine Assi
8a33ccb35a Merge branch 'master' into streaming-patches-5 2026-09-24 21:01:09 -04:00
Sam Dornan
86fa809612 fix(auth): rename seeded permission groups to Viewer and Editor
Every install showed "Viewer (legacy)" and "Editor (legacy)" as the built-in
groups, which reads as deprecated. 0092 already shipped in 5.3.0, so a new
revision renames the untouched system rows and drops the "pre-upgrade"
framing from their descriptions. It skips a group whose target name an admin
already took, and keeps a description the admin edited.

Fixes #4678

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xdb9FnfhEqP6ectkSZ2T3F
2026-09-25 00:36:34 +00:00
Georges-Antoine Assi
2eb2b5973e refactor(streaming): share the claim query params, mark-and-start the exit save pull in one call, and drop no-op casts (simplify)
- Declare the container and claimed_at query params once, with named length limits.
- Add lifecycle.start_exit_save_pull for the two callers that mark and start back to back.
- Build every claim query on the frontend through one claimParams helper.
- Drop PlayerState casts that narrowed nothing in the launch socket handlers.
- Reuse _load_session in the _drain test helper.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 17:49:59 -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
Georges-Antoine Assi
a951f7eb0b feat(v2): pin any media to the game overview
The overview's media section was fixed to scraped screenshots plus videos.
Each user can now pin any screenshot (scraped, game folder, their own or a
community upload), any artwork and any video to their own overview, in any
order.

Pins live on rom_user.pinned_media as an ordered list of stable keys
(scraped:<url>, file:<id>, screenshot:<id>, artwork:<key>), written through
the existing PUT /roms/{id}/props. NULL keeps the default selection, so
nothing changes until a user pins or unpins something, and "Reset to
default" returns to it. Keys whose media disappears are skipped, not
pruned.

- The Artwork subtab's shelf becomes MediaShelf, shared with the overview.
- The Screenshots subtab gains a read-only "Scraped" section so scraped
  screenshots can be unpinned too.
- Toggles are optimistic and chained so rapid clicks land in order.
- pinned_media is left out of the per-user sort cache bump.

Supersedes #4512.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 17:42:17 -04:00
Georges-Antoine Assi
68a3e6b262 Merge remote-tracking branch 'origin/master' into perf/retroarch-sync-manifest 2026-09-24 16:47:05 -04:00
Zurdi
404518c5e0 Merge pull request #4749 from rommapp/claude/issue-2653-7225d5
feat: rename saves and states, and one public/private look across v2
2026-09-24 22:37:54 +02:00