Commit Graph

13967 Commits

Author SHA1 Message Date
alexcastgonz
54fecf2500 fix(setup): resolve folder aliases when identifying platforms in the setup wizard (#5473)
* fix(setup): resolve folder aliases when identifying platforms in the setup wizard

The setup library endpoint returned raw folder names, so folders such as
gamecube or a config-bound nintendo-snes showed as Unidentified and their
platform stayed in the supported list. Report the resolved platform slug
next to each folder and match on it in the wizard.

Fixes #5465

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(setup): match supported platforms on resolved slug, one detected row per folder

pr-ready step 2 (code-review xhigh --fix): compare supported platforms by
slug so a DB row with an alias fs_slug still matches, keep each folder's own
name and rom count, read config once per request, black-format the new test,
and add a SetupStepPlatforms unit test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(setup): fold detected-row branches, drop redundant selection guards

pr-ready step 3 (simplify): build identified and unidentified rows from one
object, drop the detected checks in togglePlatform and newSlugsInGroup (every
caller already lists only supportedAvailable), and merge the duplicated chip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(setup): assert the resolved slug in every setup/library entry

pr-ready step 4 (review-polish): compare whole existing_platforms entries in
the older setup/library tests so they cover slug too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(setup): tighten detected-row comment

pr-ready step 5 (humanizer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(settings): resolve built-in folder aliases in folder mappings

Folder Mappings matched folders to platforms on the client by exact slug,
so alias folders like gamecube or megadrive showed as unmapped even though
the scan resolves them. The heartbeat now returns FS_PLATFORM_SLUGS, each
folder's slug from its name or built-in alias, and the table reads it for
auto-detected rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: drop response schema field comments

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-11-08 22:25:29 -05:00
Tyler Vigario
bbb7d98f53 fix(scan): look a file named by several titles up by each of them (#5478)
* fix(scan): look a file named by several titles up by each of them

No-Intro and Redump name a game released under several titles by all of
them, joined by " ~ ". Each file-name lookup now tries the full name
first and then each title, tags and extension kept, until one matches;
SteamGridDB searches the titles too. Only the title is split, never a
tag group.

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

* fix(scan): search each SteamGridDB name once

From Greptile's review: a title can repeat a name a provider already
gave, so SteamGridDB's candidate names are deduplicated, first position
kept, with a test. The new test module's docstring is one sentence, as
AGENTS.md asks.

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

* fix(scan): keep the full-name answer on a miss and cap title lookups

pr-ready step 2 (code-review xhigh --fix): return the full name's result when
every title misses, dedupe and cap titles at 4, and stop wrapping CSDb, whose
lookup only reads a (csdb-N) tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(scan): give SteamGridDB the bare titles and inline lookup args

pr-ready step 3 (simplify): add compute_titles so SteamGridDB stops re-attaching
and re-stripping tags, inline the Moby and SS platform ids, and merge the two
all-miss tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(scan): keep the narrowed Moby and SS platform ids for mypy

pr-ready step 4 (review-polish): the locals inlined in step 3 narrow the
optional platform ids, which a lambda body cannot do; restore them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(scan): reword the title cap comment

pr-ready step 5 (humanizer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-11-08 16:40:43 -05:00
Sam Dornan
48c1e8a311 perf(scan): stop quick scan re-reading unchanged ROMs (#5516) 2026-11-08 11:12:28 -06:00
Sam Dornan
1a5ab32fac fix(scan): wrap live counter chips instead of overlapping on narrow screens (#5515) 2026-11-08 09:01:33 -06:00
Sam Dornan
bca30b139a refactor(gallery): track the displayed result, refresh sorts in place, defer to page morphs (#5502) 2026-11-07 16:49:56 -06:00
Sam Dornan
4df09b9633 feat(gallery): keep results on screen and animate the swap on search (#5500) 2026-11-07 11:59:49 -06:00
Georges-Antoine Assi
a688676de7 fix: enforce ROM visibility on assets, sync, collections, stats and scan events (#5498)
* fix(sync): cap play sessions on sync completion and require roms.user.write

The completion endpoint fed an unbounded play_sessions list to the same
ingest as POST /api/play-sessions, which allows 100 per batch and requires
roms.user.write. Apply both rules before the session is completed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(config): reject empty platform binding and version values

config.yml exits on load when a platforms or versions value is empty, so
the API must not write one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(collections): require smart collection criteria to be a JSON object

Any other JSON value was stored, then failed the response schema and broke
the smart collection list for every user who could see the collection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(stats): require roms.read on /api/stats

Anonymous callers were served counts over the whole library, including
platforms and ROMs hidden from users. The UI only calls it after login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(permissions): apply ROM visibility to filters, saves, play sessions and collection removal

/api/roms/filters aggregated facet values over the whole library, GET
/api/saves/{id} and GET /api/play-sessions returned the caller's own rows on
hidden ROMs, and removing ROMs from a collection could drop members hidden
from its owner. The facet visibility clauses move onto RomVisibilityFilter so
stats and filters share them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(webhooks): keep non-admin webhooks off the admin's internal metadata origins

The SSRF exception for a self-hosted Playmatch or Hasheous applied to every
request, so a user's webhook could reach any path on that private origin.
Non-admin webhooks now validate and connect with an empty allowlist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(saves): bound total decompressed size when hashing zip archives

Zip content hashing capped each entry but not the archive, so many
entries each under the cap could still decompress and hash far more
than any real save or memory card holds. Budget the decompressed bytes
across the whole archive and cap the entry count; callers keep treating
an over-budget archive as an unknown hash.

The chunked, budgeted entry reader is shared with the memory card
archive check, and the RetroArch store path now hashes off the event
loop like its siblings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(psp): clamp LZ4 literal and match copies to the ZISO block size

The ZISO block decoder appended literals and copied matches for their
full encoded length before checking the output size, and an LZ4 length
can be extended without bound by 0xFF bytes. A small crafted block
could therefore expand far past the block size before being truncated.

Clamp each copy to the room left in the block, stop once it is full,
end the block on a truncated match offset, and copy matches with slices
instead of a per-byte loop (overlapping matches repeat their pattern).
Output for valid blocks is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(auth): revoke OAuth tokens when a user's credentials change

A password change, admin reset, reset-link reset or rename cleared the
account's web sessions, but its OAuth access tokens kept working until they
expired and its refresh tokens could still be exchanged at /api/token.

Revoking a user's credentials now also records a per-username revocation
time in Redis, kept for the longest token lifetime. Bearer validation and
refresh consumption reject any token whose iat is at or before it. OAuth
tokens now carry a sub-second iat, so a login right after the change still
works; a token without iat counts as older than any revocation.

The revocation is keyed by the token's sub, the same username sessions are
keyed by, so a rename revokes tokens issued under the old name even if
another account later takes it. Client (API) tokens are left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): reject local file URLs for user-supplied covers and manuals

file:// and launchbox-file:// URLs are meant for covers and manuals that
a scan records from gamelist.xml or LaunchBox metadata. The collection
create/update endpoints and the ROM update endpoint passed a user-supplied
url_cover (and url_manual) straight to the resource handler, which copied
whatever library file it named into the entity's resources. That let any
user with collections.write or roms.write pull files they cannot otherwise
read, including those of hidden platforms and ROMs.

These endpoints now answer 400 for a local file URL, unless it is the value
already stored, which the edit forms echo back on every save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(resources): bound cover downloads and decodes

Remote covers, screenshots, manuals, badges and media files were streamed
to disk with no size limit, and a gzip-encoded body was read whole and
inflated in memory. Downloads now go through one helper that counts bytes
against MAX_ASSET_UPLOAD_SIZE_BYTES, inflates gzip incrementally under the
same cap, and aborts past it, so the partial file is removed and any
earlier copy kept.

Covers are also bounded once on disk: a still image whose header declares
more than MAX_COVER_PIXELS is discarded before it is decoded (and an
uploaded one is refused with a 400), and a DecompressionBombError while
deriving the small cover now discards the download instead of failing the
request and leaving the file behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: fix mypy errors in the new tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: address Greptile review on permission and input hardening

- Date OAuth tokens to before the credential check, so a password change
  that lands during the check revokes the tokens it issues.
- Apply ROM visibility to play sessions in SQL, before the page slice.
- Reject truncated gzip bodies and inflate every gzip member.
- Shorten the zip budget comment; stream real httpx2 responses in tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: apply code-review findings on permission hardening

Revoke OAuth tokens and sessions on user deletion, apply ROM visibility to
GET /states/{id}, validate update_collection rom_ids, run get_rom_filters off
the event loop, and reuse the shared httpx client factory for webhooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: apply simplify pass on permission hardening

Read the OAuth revocation stamp through the async cache, share the
play-session batch-size check, raise a plain OSError for oversized downloads,
and drop a dead slice in the LZ4 decoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style: apply review-polish pass on permission hardening

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: state that ROM visibility is enforced as access control

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(assets): hide saves, states, screenshots and memory cards on hidden ROMs

Visibility is access control, so per-id save/state/screenshot routes now 404
when the save's ROM is hidden from the caller (hidden ROM, hidden platform or
age limit), and the save/state lists and identifier lists leave those rows
out in SQL. GET /api/saves/summary 404s on a hidden ROM. Memory cards on a
hidden platform 404 on every per-id route, drop out of both lists, and can't
be created against a hidden platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(saves): answer a hidden ROM's save summary like a missing one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(permissions): enforce ROM visibility in sync, installs and feeds

Hidden ROMs/platforms and age-limited ROMs are access control, so the
paths that skipped the caller's visibility now apply it:

- sync negotiate: saves on hidden ROMs are neither offered, paired nor
  reported as conflicts; a client save on one negotiates like an unknown ROM
- push-pull SSH sync: resolves the device owner's visibility and skips
  saves on hidden ROMs in both directions
- device installs: list and claim leave out requests whose ROM became
  hidden (they stay pending), and outcome notifications don't name it
- recommendations: a hidden seed ROM is no longer named
- music playlists: track_count counts only tracks on visible ROMs
- audit events: firmware targets on hidden platforms are filtered
- setup library: supported platforms honour the caller's visibility
- feeds: a hidden platform found by slug reads as missing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(visibility): hide ROMs from virtual collections, stats and scan events

Virtual collections apply the caller's visibility in SQL: a collection with
no visible member is left out (404 by id), member ids and covers skip hidden
ROMs, and the limit counts only visible collections.

Stats save, state and screenshot totals skip assets of hidden ROMs.

Scan events no longer broadcast to every socket. Progress and end events go
to a scan room that sockets of users holding platforms.write or tasks.run
join on connect. scanning_rom and scanning_platform go to the user rooms of
those followers who can see that ROM or platform, resolved once per scan
and grouped by visibility. get_rom_audience now builds on a shared
get_user_visibilities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: apply code-review findings on ROM visibility enforcement

Match virtual collection members by ROM id, build the cover visibility clauses
once, filter feed platforms by visibility in SQL, resolve every id before a
batch save or state delete, filter push-pull saves in the query, and narrow the
hides query to the requested users.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: apply simplify pass on ROM visibility enforcement

Require an explicit visibility filter on the saves, states and memory card
queries, share one roms_facets visibility join and one owned-asset helper,
filter virtual collection members by hidden ids, batch the scan audience's
scope lookup, and move the empty-room emit guard into socket_handler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: start the scan audience before emitting from scan_rom

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: apply humanizer pass on the visibility rule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(streaming): don't mount a memory card on a hidden platform

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: address Greptile review on ROM visibility enforcement

Refresh a running scan's audience after a permission change, fix the precedence
of the scan-room join assertion, and narrow mock await_args before reading them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* revert: drop per-visibility scan event audience

Scan events go back to every socket. Removes handler/scan/audience.py,
the scan room join on connect, the permissions generation bump and the
batched OAuth scope resolution that only the audience used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:33:11 -05:00
Sam Dornan
59a0336450 feat(recommendations): show 10 similar games to match IGDB (#5497)
* Show 10 RomM similar games to match IGDB

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4fhnTdQKSgP7jiFjga

* Update SIMILAR_ROMS_LIMIT comment for the new limit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4fhnTdQKSgP7jiFjga

* Trim SIMILAR_ROMS_LIMIT comment to the current fact

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4fhnTdQKSgP7jiFjga

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 11:37:39 -06:00
Georges-Antoine Assi
37e4ca304d fix: permission, validation and resource-limit hardening (#5496)
* fix(sync): cap play sessions on sync completion and require roms.user.write

The completion endpoint fed an unbounded play_sessions list to the same
ingest as POST /api/play-sessions, which allows 100 per batch and requires
roms.user.write. Apply both rules before the session is completed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(config): reject empty platform binding and version values

config.yml exits on load when a platforms or versions value is empty, so
the API must not write one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(collections): require smart collection criteria to be a JSON object

Any other JSON value was stored, then failed the response schema and broke
the smart collection list for every user who could see the collection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(stats): require roms.read on /api/stats

Anonymous callers were served counts over the whole library, including
platforms and ROMs hidden from users. The UI only calls it after login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(permissions): apply ROM visibility to filters, saves, play sessions and collection removal

/api/roms/filters aggregated facet values over the whole library, GET
/api/saves/{id} and GET /api/play-sessions returned the caller's own rows on
hidden ROMs, and removing ROMs from a collection could drop members hidden
from its owner. The facet visibility clauses move onto RomVisibilityFilter so
stats and filters share them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(webhooks): keep non-admin webhooks off the admin's internal metadata origins

The SSRF exception for a self-hosted Playmatch or Hasheous applied to every
request, so a user's webhook could reach any path on that private origin.
Non-admin webhooks now validate and connect with an empty allowlist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(saves): bound total decompressed size when hashing zip archives

Zip content hashing capped each entry but not the archive, so many
entries each under the cap could still decompress and hash far more
than any real save or memory card holds. Budget the decompressed bytes
across the whole archive and cap the entry count; callers keep treating
an over-budget archive as an unknown hash.

The chunked, budgeted entry reader is shared with the memory card
archive check, and the RetroArch store path now hashes off the event
loop like its siblings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(psp): clamp LZ4 literal and match copies to the ZISO block size

The ZISO block decoder appended literals and copied matches for their
full encoded length before checking the output size, and an LZ4 length
can be extended without bound by 0xFF bytes. A small crafted block
could therefore expand far past the block size before being truncated.

Clamp each copy to the room left in the block, stop once it is full,
end the block on a truncated match offset, and copy matches with slices
instead of a per-byte loop (overlapping matches repeat their pattern).
Output for valid blocks is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(auth): revoke OAuth tokens when a user's credentials change

A password change, admin reset, reset-link reset or rename cleared the
account's web sessions, but its OAuth access tokens kept working until they
expired and its refresh tokens could still be exchanged at /api/token.

Revoking a user's credentials now also records a per-username revocation
time in Redis, kept for the longest token lifetime. Bearer validation and
refresh consumption reject any token whose iat is at or before it. OAuth
tokens now carry a sub-second iat, so a login right after the change still
works; a token without iat counts as older than any revocation.

The revocation is keyed by the token's sub, the same username sessions are
keyed by, so a rename revokes tokens issued under the old name even if
another account later takes it. Client (API) tokens are left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): reject local file URLs for user-supplied covers and manuals

file:// and launchbox-file:// URLs are meant for covers and manuals that
a scan records from gamelist.xml or LaunchBox metadata. The collection
create/update endpoints and the ROM update endpoint passed a user-supplied
url_cover (and url_manual) straight to the resource handler, which copied
whatever library file it named into the entity's resources. That let any
user with collections.write or roms.write pull files they cannot otherwise
read, including those of hidden platforms and ROMs.

These endpoints now answer 400 for a local file URL, unless it is the value
already stored, which the edit forms echo back on every save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(resources): bound cover downloads and decodes

Remote covers, screenshots, manuals, badges and media files were streamed
to disk with no size limit, and a gzip-encoded body was read whole and
inflated in memory. Downloads now go through one helper that counts bytes
against MAX_ASSET_UPLOAD_SIZE_BYTES, inflates gzip incrementally under the
same cap, and aborts past it, so the partial file is removed and any
earlier copy kept.

Covers are also bounded once on disk: a still image whose header declares
more than MAX_COVER_PIXELS is discarded before it is decoded (and an
uploaded one is refused with a 400), and a DecompressionBombError while
deriving the small cover now discards the download instead of failing the
request and leaving the file behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: fix mypy errors in the new tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: address Greptile review on permission and input hardening

- Date OAuth tokens to before the credential check, so a password change
  that lands during the check revokes the tokens it issues.
- Apply ROM visibility to play sessions in SQL, before the page slice.
- Reject truncated gzip bodies and inflate every gzip member.
- Shorten the zip budget comment; stream real httpx2 responses in tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: apply code-review findings on permission hardening

Revoke OAuth tokens and sessions on user deletion, apply ROM visibility to
GET /states/{id}, validate update_collection rom_ids, run get_rom_filters off
the event loop, and reuse the shared httpx client factory for webhooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: apply simplify pass on permission hardening

Read the OAuth revocation stamp through the async cache, share the
play-session batch-size check, raise a plain OSError for oversized downloads,
and drop a dead slice in the LZ4 decoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style: apply review-polish pass on permission hardening

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(play-sessions): filter rom_id and device_id on PlaySession after the visibility join

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 11:39:30 -05:00
Georges-Antoine Assi
988e93b644 Merge commit from fork
X-Accel-Redirect keeps only a few of the backend's response headers, so the
Content-Security-Policy and nosniff headers set for inline files never
reached the browser. Set them on the internal /library/ location, reusing
the resources CSP that already exempts PDFs.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 09:28:25 -05:00
renovate[bot]
8d98ec2cea chore(deps): update github actions (#5494)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-05 16:10:33 -06:00
renovate[bot]
3224220a1f chore(deps): update dependency rq to v3 (#5493)
* chore(deps): update dependency rq to v3

* fix: adapt the RQ worker and job types to rq 3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix: update worker tests and task status map for rq 3

The worker tests pass the Execution to perform_job and patch the
module-level execute_failure_callback. TaskStatusItem covers the new
rate_limited and ready_to_enqueue statuses, shown as queued.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sam Dornan <sam.dornan@athleticgreens.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-11-05 10:39:35 -05:00
renovate[bot]
e904f3eff0 chore(deps): update dependency mypy to v2.4.1 (#5492)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-05 09:18:16 -06:00
renovate[bot]
ea7f286f57 chore(deps): update dependency @types/node to v26.6.6 (#5491)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-05 10:17:37 -05:00
renovate[bot]
1bc9a402b7 chore(deps): update node.js to v26 (#5469)
* chore(deps): update node.js to v26

* chore(deps): move the Node runtime pins to 26.13

Addresses Greptile's review: the engines and @types/node bump needs
frontend/.nvmrc and both Dockerfiles on Node 26 too, or npm ci fails
with EBADENGINE under engine-strict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:12:46 -05:00
renovate[bot]
cf757db8b6 chore(deps): update backend dependencies (#5483)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-04 11:55:07 -06:00
renovate[bot]
9bece10ea6 chore(deps): update frontend dependencies to v10.6.5 (#5484)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-04 11:54:33 -06:00
renovate[bot]
d328779435 chore(deps): update valkey/valkey docker tag to v9.0.7 (#5467)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-04 10:52:39 -05:00
renovate[bot]
e923ced4f0 chore(deps): update astral-sh/setup-uv action to v10.3.3 (#5466)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-04 08:57:51 -05:00
Georges-Antoine Assi
f66950551a fix(sync): bind device tokens to their device; dial only known push-pull hosts (#5460)
* fix(sync): bind device tokens to their device; dial only known push-pull hosts

A client token paired to one device could read, reconfigure, delete, sync
saves for and record play sessions as any other device of the same user.
Device CRUD, sync negotiate/complete, push-pull trigger, the save device
resolver and play-session ingest now treat another device as not found for
a bound token, through a shared require_token_device helper. GET /api/devices
lists only the bound device.

Push-pull let any user with devices.write point ssh_host at any host and
port, and the connection error surfaced through the sync session, so the
worker could be used to probe the internal network. The SSH handler now
refuses a host with no trusted key or CA in the admin's known_hosts before
dialling it, which keeps LAN handhelds working while nothing else is
reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(device): revoke a deleted device's tokens; scope registration matches

Addresses Greptile review on #5460. Deleting a device now deletes the client
tokens paired to it, since the foreign key's SET NULL turned them into unbound
tokens that reach every device. Registration with a bound token only matches
its own device by fingerprint, so it can no longer reset syncs or overwrite
capabilities on another device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sync): bind heartbeat, sync session and online reads; pin push-pull ports

pr-ready step 2 (code-review xhigh --fix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(device): one require_device helper; parse known_hosts once

pr-ready step 3 (simplify).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(sync): narrow await_args before reading known_hosts

pr-ready step 4 (review-polish).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(sync): plainer comments on the push-pull allowlist and token revoke

pr-ready step 5 (humanizer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(device): keep bound tokens off other tokens; cascade tokens with their device

A device-bound token can no longer create tokens, or regenerate, pair or
revoke a token of another device or an unbound one. The save session_id
counter only counts a session of the caller's bound device.

client_tokens.device_id now cascades on device delete (0159), so no path
can leave an unbound token behind, and deleting a device records a
client_token.revoke audit event for each token it takes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(env): drop the push-pull allowlist note from env.template

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 08:57:33 -05:00
Georges-Antoine Assi
58e2fdbadb fix(streaming): let multi-disc games pick a starting disc (#5446)
* fix(streaming): let multi-disc games pick a starting disc

The streaming launch screen had no disc selector, so a multi-disc game
always started on its first disc. The claim now takes an optional
disc_file_id. Containers with a tray route mount the playlist as before
and swap to the pick once the game is up (a resumed state's own disc
still wins); anything else boots the picked disc file directly.

Fixes #5271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(streaming): boot a resumed state's disc and record a directly booted disc

Addresses Greptile review on #5446.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:40:09 -05:00
Sam Dornan
4b01bebfb8 fix(users): unlink RetroAchievements when ra_username is sent empty (#5475) 2026-11-03 07:48:47 -06:00
Sam Dornan
260abdfd8f test: date "later" saves and states a year ahead, not in 2099 (#5474) 2026-11-03 07:44:16 -06:00
renovate[bot]
b96a9e8a30 chore(deps): update frontend dependencies (#5468)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-03 08:02:53 -05:00
Sam Dornan
70061f317a fix(users): clear an email sent empty under FastAPI 0.162, and lift the pin (#5472) 2026-11-02 17:03:36 -06:00
Sam Dornan
5dda10ef2d docs(agents): note gh --attach needs 2.99.0 and fails in cloud sessions (#5470) 2026-11-02 17:00:05 -06:00
renovate[bot]
77757301ba chore(deps): update backend dependencies (#5449)
* chore(deps): update backend dependencies

* fix: keep empty form values cleared under FastAPI 0.162

FastAPI 0.149 started parsing an empty form string as a missing field, so
the field's default (None) applied. Clients clear a user's email, a
collection's description or remote cover, and ROM fields by sending them
empty, and those updates were silently ignored. keep_empty_string restores
the submitted "" from the raw form.

The CSRF and session tampering tests set a cookie next to the one the
TestClient jar already held for the response domain; the client now sends
both and the original wins. Clear the jar first, as a browser would replace it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(deps): hold fastapi below 0.149

FastAPI 0.149 parses an empty value in a form model as a missing field, so
PUT /api/users/{id} with email="" kept the old address. Stay on 0.148 and
stop Renovate from proposing 0.149+ until the update endpoints can tell an
absent field from an empty one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(deps): hold fastapi at 0.146

FastAPI 0.147 started reading a missing bool field in a form model as
false, so PUT /api/users/{id} with only a role also disabled the account.
Keep the version master runs and cap Renovate below 0.147 until the update
endpoints tell absent, empty and false apart themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:29:49 -05:00
Georges-Antoine Assi
900fe515ea fix(sync): match RetroArch saves named after a ROM's files (#5445)
* fix(sync): match RetroArch saves named after a ROM's files

RetroArch names a save after the file it launched, so a disc or a
translation inside a multi-file game folder uploaded a save that matched
no ROM. When no ROM carries the name, saves now resolve to the ROM owning
a file with that stem. Those saves stay unslotted under their own name,
since a ROM's autosave lineage holds one save per core and the discs
would overwrite each other. States keep matching on the ROM name only,
because their slots are advertised under it.

Fixes #5364

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sync): write a case-variant reupload to the stored save's own file

Addresses Greptile review on #5445.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sync): match a stored save's name in any case on PostgreSQL

The RetroArch save lookup relied on MariaDB's case-insensitive collation, so
on PostgreSQL a reupload in another case created a second save instead of
replacing the stored one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:48:42 -05:00
Georges-Antoine Assi
cf47d4572f fix(player): point RetroArch's system directory at PUAE Kickstarts (#5444)
* fix(player): point RetroArch's system directory at PUAE Kickstarts

EmulatorJS's retroarch.cfg has no system_directory, so RetroArch falls
back to the content directory. WHDLoad games packed in a subfolder then
miss the Kickstarts RomM writes to the system directory, and PUAE boots
AROS instead.

When EJS_externalFiles targets the system directory (only PUAE today),
append system_directory to retroarch.cfg as soon as gameManager is
assigned, before the core boots. Other cores keep the content directory
fallback, since EJS_biosUrl and keepArcadeBiosWhole put their BIOS there.

Fixes #5247

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(player): reword the system directory comment per Greptile review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:16:29 -05:00
Georges-Antoine Assi
31eb7dbdb2 docs(readme): add RomP and RommPS, drop Syncthing sync (#5459)
* docs(readme): add RomP, RommPS and GRID Launcher, drop Syncthing sync

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(readme): leave GRID Launcher out until it reaches 10 stars

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:12:01 -05:00
github-actions[bot]
97b4b57953 chore(trunk): Upgrade trunk (#5456)
* chore(trunk): Upgrade trunk

* fix(trunk): keep pinact on 4.1.1 until the plugin passes --format

Addresses Greptile's review: the pinned trunk-io/plugins wrapper runs
pinact with single-dash long flags, which pinact 5 rejects. The upstream
fix is trunk-io/plugins#1180.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:10:22 -05:00
Georges-Antoine Assi
8a82d4a5a5 fix(upload): recheck platform visibility when completing a chunked upload (#5458)
/start checked that the caller could see the platform, but /complete wrote
into the platform folder using the fs_slug cached in the upload session. An
Editor who opened a session before an admin hid the platform could still
finish it during the 24h session TTL.

Completion now re-resolves the platform through the same helper /start
uses, so a hidden or deleted platform answers "Platform not found" and the
staged chunks are cleaned up. The session no longer caches the fs_slug; the
folder comes from the platform's current row. The ROM-folder branch already
rechecked ROM visibility at completion.


Claude-Session: https://claude.ai/code/session_011waFLHbQCsqHfeX1CKGZ7s

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 08:07:43 -05:00
Sam Dornan
de38cc0e75 chore(deps): bump dnspython to 2.9.0 for CVE-2026-114605 (#5448) 2026-11-02 07:06:55 -06:00
renovate[bot]
44a459bef7 chore(deps): update frontend dependencies (#5450)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-02 07:58:51 -05:00
Georges-Antoine Assi
3fc0740c02 fix(tasks): re-register RQ workers whose registration expired (#5443)
After a host suspend longer than the worker TTL, the worker key lapses and
the registry sweep drops the worker, or the next heartbeat recreates the key
with only last_heartbeat. register_birth() only runs at startup, so the scan
worker stayed invisible and every scan was refused with "No scan worker is
listening" until a restart.

RomMWorker.heartbeat() now checks the key still carries its queues and sits
in the worker registries, and writes the registration back when it does not.

Fixes #5327

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 07:55:43 -05:00
Georges-Antoine Assi
257025ccd7 fix(downloads): keep converted copies' ETag stable so downloads resume (#5442)
Serving a cached conversion touched the copy's mtime to record demand for
TTL cleanup, and nginx builds its default ETag from mtime and size, so the
ETag changed on every request and Range/If-Range resumes always got a full
200. Record serves on a `.served` marker in the key dir instead; cleanup
already takes the newest mtime among the dir's files, so it reads the
marker and falls back to the copy's own mtime, and removes the marker
with the dir.

Fixes #5239

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 07:44:08 -05:00
Sam Dornan
183ee3b89f feat(platforms): enrich discovery cards and preserve AVIF animations (#5433)
Fetch original launch years and current platform logos during scans, retain curated platform icons, and show launch year and type on responsive discovery cards. Preserve animated AVIF frames during thumbnail and WebP conversion.

Closes rommapp/romm#5432

Authored with Codex assistance, including implementation and tests.
2026-11-01 19:23:51 -06:00
Georges-Antoine Assi
6f0d910dc5 fix(firmware): verify firmware by hash regardless of name or platform (#5441)
* fix(firmware): verify firmware by hash regardless of name or platform

A correct BIOS dump went unverified when renamed (even case-only) or
placed under a sibling platform folder, because verification only ran
after a name+platform lookup in the known BIOS list. Keep that lookup as
the fast path, then fall back to a cached (size, md5/sha1) index over the
whole fixture.

Fixes #5329

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(scan): recheck stored firmware hashes on scans that skip rehashing

Addresses Greptile review on #5441.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Revert "fix(scan): recheck stored firmware hashes on scans that skip rehashing"

This reverts commit 04efbd7e91.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 19:37:12 -05:00
Georges-Antoine Assi
2a3cefb9e8 fix(player): keep the CD-i BIOS archive whole for same_cdi (#5440)
EmulatorJS 4.2.3 unpacks the BIOS archive and writes its members loose at
the content root, so same_cdi (MAME-based) never finds cdimono1.zip or a
cdimono1/ folder on its rompath and reports cdi200.rom as missing. Route
the same_cdi core through keepArcadeBiosWhole so cdimono1.zip lands whole
at the root, which is the first rompath entry the core searches.

Fixes #5215

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 19:28:21 -05:00
Sam Dornan
4393b70973 feat(media): JPEG XL library images and cover uploads (#5438)
* feat(media): serve JPEG XL library images inline

Add .jxl to the image extensions the download endpoint serves inline,
with an explicit image/jxl type since mimetypes doesn't know it, and to
the frontend lists that pick artwork and folder screenshots out of
rom.files. AVIF was already covered; the new test pins both.

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

* feat(media): accept JPEG XL cover uploads through a Pillow plugin

Pillow 13 reads AVIF but not JPEG XL. pillow-jxl-plugin registers a
JXL codec with Pillow (imported once in utils/images, which the cover
and WebP-conversion code already load). It ships musllinux wheels for
the image's amd64 and arm64 builds.

ROM and collection artwork uploads now accept image/jxl and store it
re-encoded as PNG, since covers are served in their stored format and
not every browser renders JPEG XL. Avatars, stored as uploaded, keep
the PNG/JPEG/WebP/GIF allowlist.

The plugin is GPL-3.0, which is compatible with RomM's AGPL-3.0.

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

* test(roms): expect JPEG XL in the artwork rejection message

Artwork uploads now also accept JPEG XL, so the rejection message lists
it. The collection tests were updated with the change; this ROM one was
missed.

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

* fix(media): list library JPEG XL images only where the browser renders them

Library files are served as stored, and Chrome and Firefox render no
JPEG XL, so .jxl artwork and folder screenshots showed as broken tiles
there. A one-time probe decodes a 22-byte JPEG XL image and the artwork
and screenshot lists only include .jxl files once it succeeds (Safari),
updating reactively when the answer arrives. Chromium 153 fails the
probe, so the files stay hidden there as before.

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

* fix(media): size-check JPEG XL before decoding and keep it out of screenshot uploads

pillow-jxl decodes every pixel in _open(), before Pillow's
decompression-bomb check sees the size, so a small, highly compressed
JXL declaring a huge canvas could exhaust memory. utils/jxl reads the
width and height from the codestream SizeHeader (bare or inside a
container) and runs Pillow's own bomb check on them first, then
registers this guarded decoder in place of the plugin's.

The decoder raises RuntimeError on a corrupt file, which escaped
store_artwork as a 500. The guard turns it into SyntaxError, so Pillow
reports UnidentifiedImageError and the upload takes the same path as a
corrupt PNG.

POST /api/screenshots validated against the library inline list, so it
started accepting .jxl, but the asset endpoint serves those as
attachments. Screenshot uploads now use their own list without JPEG XL.

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

* style(media): one-sentence jxl docstring and a narrowed mock call in the JXL test

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

* style(media): one-sentence canRenderJxl doc comment

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:14:06 -06:00
Sam Dornan
34b01e3ec6 fix(menu): return focus to the activator when the menu closes (#5437)
* fix(RMenu): return focus to the activator when the menu closes

Picking an item, pressing Escape or pad B unmounted the panel with focus
inside it, so focus fell to <body> and keyboard and gamepad users lost
their place in the toolbar. RMenu now moves focus back to its activator
whenever it closes with focus inside the panel, like a native menu
button. Focus an item handler already moved elsewhere is left alone.

The return happens before the open state flips, so a dialog opened from
an item records the activator (not the unmounting item) as the element
to restore on its own close. A sync watcher covers controlled menus the
parent closes without going through close().

focusFromInput keeps the ring modality-gated: visible after a key or pad
pick, none after a mouse click or tap.

Adds unit tests for item pick, Escape, mouse pick, a handler that moves
focus away, and a parent-closed controlled menu, plus a Storybook play()
that opens the menu from the keyboard, picks an item and asserts focus
is back on the activator.

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

* refactor(menu): trim the focus-return comment and a duplicated test

Shortens the focus-return comment to the repo's two-line limit and drops
the Escape unit test, whose interaction the KeyboardFocusReturn story's
play() already covers in the browser.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:58:23 -06:00
Sam Dornan
a100ad9322 chore(docker): refresh base image digests and let Renovate track them (#5439) 2026-11-01 11:15:07 -06:00
Sam Dornan
63d9a39656 feat(platforms): facet filters and a group-by menu on the platforms index (#5434) 2026-11-01 09:28:17 -06:00
Georges-Antoine Assi
f6002a76a3 fix(switch): explain why encrypted dumps get no title id (#5428)
* fix(switch): explain why encrypted dumps get no title id

RomM doesn't read prod.keys, so encrypted retail NSP/XCI dumps resolve no
title id, and nothing said so. A scan now logs one info line counting the
encrypted Switch files it skipped, a Switch game without a title id says
why on its metadata tab, and key files in the Firmware tab are marked as
not used by RomM.

Fixes #5330

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(switch): keep each scan's encrypted file count separate

Addresses Greptile's review on #5428: scans overlapping in one process
(DEV_MODE) shared the module-level set, so a second scan's begin_scan
cleared the first's count. The set now lives in a context var that each
scan's rom tasks inherit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:22:23 -05:00
Georges-Antoine Assi
fe11afefe3 feat(oidc): add OIDC_AUTH_PARAMS for extra authorization request parameters (#5431)
* feat(oidc): add OIDC_AUTH_PARAMS for extra authorization request parameters

Lets admins send provider options such as prompt=select_account on the
OIDC login redirect. Authlib's authorize_params override its generated
state, nonce and PKCE values, so the parameters RomM manages are
rejected at startup.

Closes #5406

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(oidc): trim parse_oidc_auth_params docstring

Addresses Greptile review on #5431.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:04:00 -05:00
Sam Dornan
5b96522252 test: raise libretro HEAD timeout to 1.0s in the fake-server fixture (#5436) 2026-11-01 07:53:13 -06:00
Sam Dornan
1642a323c0 fix(sort): strip only configured articles, and keep custom sort keys as typed (#5429) 2026-10-31 19:17:00 -05:00
Sam Dornan
b62a81b968 fix(scan): strip .p8 from PICO-8 cart titles so LaunchBox can match them (#5427) 2026-10-31 18:29:41 -05:00
Georges-Antoine Assi
0f75e6aaf4 fix(client-tokens): let a client token revoke itself without me.write (#5419)
* fix(client-tokens): let a client token revoke itself without me.write

A device that signs out or re-pairs had no way to revoke its own token
unless it held me.write, which also lets it mint tokens and approve
pairings. DELETE /api/client-tokens/{id} now skips the me.write check
when the id is the token authenticating the request.

Fixes #5274

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(client-tokens): code-review pass on self-revoke

Annotate raise_auth_error as NoReturn, trim the delete_token docstring, and
cover a me.write token revoking a sibling, the revoked token failing to
authenticate, and socket closure on self-revoke.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(client-tokens): revoke the calling token through DELETE /current

Self-revoke moves to an id-less route so a device never needs to know its
token id, and DELETE /{token_id} keeps me.write in its decorator and in
OpenAPI. The device-authorization token response now also returns token_id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(client-tokens): simplify pass, reuse raise_auth_error for /current

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* revert(client-tokens): drop DELETE /current and the device-flow token_id

Self-revoke stays on DELETE /{token_id} with the in-handler check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(device-auth): return the issued token's id from the device token poll

A device paired through the device-authorization flow can now revoke its
own token with DELETE /api/client-tokens/{id}, as tokens from /exchange can.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Update docs/BACKEND_ARCHITECTURE.md

* docs: format client tokens table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 19:05:52 -04:00
Georges-Antoine Assi
f10efbc625 test: keep the NUL media path out of the PostgreSQL seed (#5420)
PostgreSQL jsonb rejects \u0000, so seeding ss_metadata with the
NUL-byte miximage path failed before the request ran. The seed only
needs the URLs; the request still sends every path under test.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 18:33:45 -04:00