Commit Graph

13582 Commits

Author SHA1 Message Date
renovate[bot]
b535ed0e6f chore(deps): update backend dependencies 2026-10-01 17:03:30 +00:00
Georges-Antoine Assi
b8650d230b Merge pull request #4986 from LoneAngelFayt/fix/firmware-upload-filename
fix(firmware): store uploads under the name written to disk
2026-10-01 12:28:01 -04:00
Georges-Antoine Assi
54e377ca9d Merge pull request #4982 from rommapp/claude/rq-slim-imports-7m0jrn
perf: keep task code out of the cron scheduler and idle RQ workers
2026-10-01 12:16:26 -04:00
Georges-Antoine Assi
17765df6b2 fix(tasks): keep failure reports and queue choice on the task spec
report_task_failure can run in the worker parent when a work horse is
killed, so it now enqueues notify_task_failure on the default queue
instead of loading the notification stack there.

enqueue_task defaults to the queue its spec names. The streaming worker
runs as PreloadingWorker, which imports the enabled scheduled tasks of
its queues, so the reaper's per-minute horse inherits its stack. Spec
tests now read config in a fresh interpreter instead of comparing a
value with itself.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 11:29:52 -04:00
Georges-Antoine Assi
c21f2c3905 test(recommendation): patch enqueue_task where the builder imports it
Review-polish pass: the builder now imports enqueue_task at module level.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 11:08:30 -04:00
Georges-Antoine Assi
656c85bc46 refactor(tasks): simplify pass on the task catalog split
Loads every model where the engine is built rather than per job, so only
processes that touch the ORM pay for it. Resolves task paths with RQ's
import_attribute, references the scan failure callback by path, hoists
the recommendations builder's registry import now that the registry
loads no task modules, and gates push-pull on its spec.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 11:06:27 -04:00
Georges-Antoine Assi
e62c452ea9 fix(tasks): code-review pass on the task catalog split
Loads every model before a job resolves its task, so the mappers
configure in a work horse that imported a single task module. Moves the
httpx2 import into RemoteFilePullTask.run, builds the push-pull job meta
from its spec, gates the scheduled scan on its spec, and widens the
loaded-modules test to cover task modules and httpx2.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 11:00:39 -04:00
Georges-Antoine Assi
d3c7be82e3 Merge pull request #4981 from rommapp/claude/rom-lazy-load-memory-7m0jrn
perf: trim idle memory of the backend processes
2026-10-01 10:34:29 -04:00
Georges-Antoine Assi
704dd6cf84 Merge pull request #4980 from rommapp/fix/v2-pair-route
Render the v2 pair page and share the auth footer
2026-10-01 10:28:50 -04:00
Georges-Antoine Assi
36c53a32eb Merge remote-tracking branch 'origin/master' into fix/v2-pair-route
# Conflicts:
#	frontend/src/v2/layouts/AuthLayout.vue
#	frontend/src/v2/views/DevicePairShell.vue
#	frontend/src/v2/views/PairShell.vue
2026-10-01 10:19:02 -04:00
Georges-Antoine Assi
9b9217ceae Merge pull request #4974 from LoneAngelFayt/fix/streaming-desktop-pad-nav
fix(streaming): let the desktop session own the controller
2026-10-01 09:09:04 -04:00
Georges-Antoine Assi
1f2abb6974 Merge pull request #4971 from andest01/fix/wcag-aa-misc-fixes
chore(wcag): AA misc fixes
2026-10-01 08:36:12 -04:00
Georges-Antoine Assi
c6fd1bd130 fix(confirm): open confirm dialogs on Cancel
ConfirmDialog focused Cancel on the next tick, but RDialog's own initial focus
ran after it and landed on the header's close button. Mark Cancel autofocus,
which RDialog already prefers, so a stray A or Enter cancels as intended.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 07:54:24 -04:00
Georges-Antoine Assi
77cf9f6cb0 fix(a11y): floor aria-valuenow so progress bars never announce 100 early
Addresses Greptile's review on #4971: rounding reported 100 at 99.6%.
Flooring keeps the value a whole number.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 07:16:32 -04:00
Georges-Antoine Assi
cfbf78d7c8 Move through the gallery grid with Home, End and the page keys
Home and End go to the ends of the row, and with Ctrl to the first and
last item of the grid. A row of one cell (list view) has nowhere to go
inside it, so there Home and End move through the grid too. PageUp and
PageDown move about one viewport of rows, keeping the column. The
gallery and Missing games scroll the virtualised list to the edge row
and wait for it to load before focusing it.

The list row's click, Space and context-menu handlers move onto its
name link, which already takes every click on the row, so the row
element carries no handlers of its own.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 23:12:31 -04:00
Georges-Antoine Assi
23fe4e7c12 refactor(player): drive the playing flag through usePlayingWhile
Pico8, Ruffle, JsDos and EmulatorJS each set and cleared the flag by hand next
to gameRunning, with their own unmount resets. Each now mirrors gameRunning
through usePlayingWhile, which clears the flag on dispose. JsDos hands input
back at unmount rather than in teardown; every exit from a running JsDos
replaces the document, so the difference is not observable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 23:03:50 -04:00
Georges-Antoine Assi
a00b0cb0cb fix(input): move focus by arrow and D-pad inside open overlays
Spatial nav used to bail whenever an overlay was open, and no dialog moves
focus on arrows, so a pad could only reach a dialog's first control:
ConfirmDialog's Confirm was unreachable app-wide. It now moves focus among the
controls of the topmost overlay's panel, including a dialog over a running
game, which replaces Stream's own exit-dialog arrow handler.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 23:03:47 -04:00
Georges-Antoine Assi
d6d98ebdfa Make the gallery an ARIA grid
The gallery's rows now form a role="grid" with aria-multiselectable,
aria-rowcount and aria-rowindex. Each card sits in a gridcell carrying
aria-selected; in list view each row is a role="row" of gridcells
with aria-selected, under a header row of columnheaders that carry
aria-sort. Letter headings are rowheaders and skeleton rows are hidden.

RVirtualScroller gains bodyAttrs and a #head slot so the grid can own
the list header row without the toolbar above it. The list row's root
is now a div, and its name is the link, stretched over the row so a
click anywhere still opens the game.

useGridNav gains a roving mode that keeps a single tab stop in the
grid, including for rows mounted while scrolling. Space selects the
focused card or row and Shift+Space selects a range. This replaces the
Selected/Not selected description, whose strings are removed.

The Missing games list gets the same grid semantics and arrow keys.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 22:49:22 -04:00
Zach Clendenen
8e481a9531 fix(firmware): store uploads under the name written to disk
write_file saves each upload under its sanitized basename, but the
firmware lookup, scan, hash check and audit record used the raw
client filename. A name with a directory part (sub/x.bin, ../x.bin)
wrote the file, then failed the scan with a 500 and left it on disk
with no row. An overlong name raised an unhandled ValueError.

Sanitize every name before writing anything, return 400 for a bad
one, and use the sanitized name throughout.
2026-09-30 21:48:36 -05:00
Georges-Antoine Assi
0d549b4888 docs(streaming): humanizer pass on the exit chord comments
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 22:47:31 -04:00
dependabot[bot]
acafe37287 chore(deps): bump tornado from 6.5.8 to 6.5.9 (#4985) 2026-09-30 22:46:20 -04:00
Georges-Antoine Assi
647bc61491 refactor(streaming): simplify pass on the exit chord move
Share one flag-mirror helper between useStageActive and usePlayingWhile, add a
deferred() test helper for Desktop's hand-answered calls, and note that players
opt into the pad exit by listening for gamepad:exitchord.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 22:45:54 -04:00
Sam Dornan
a31136cd21 Keep the FULLTEXT index on searches with short words or stopwords (#4970) 2026-09-30 22:45:44 -04:00
Georges-Antoine Assi
acfa9d97b3 fix(streaming): code-review pass on the exit chord move
Release a desktop claim still held at unmount, mark an unstarted chord hold
with null rather than 0, and cover the Stream listener, the held-through-close
latch, and escape-stack cleanup in tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 22:44:13 -04:00
Claude
87d00a54b2 revert: keep starting the RQ streaming worker unconditionally
Reading streaming.enabled from config.yml in the init script couples the
shell to the YAML config, and the worker's isolation is what keeps a slow
teardown or exit save pull off the shared task worker (#4632). The worker
stays always-on; its idle cost is reduced separately by slimming what RQ
worker parents import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh1SRMfuK7BZmf6YxMqSyT
2026-10-01 02:40:31 +00:00
Georges-Antoine Assi
d3792142ab refactor(gamepad): detect the exit chord in useGamepad's frame loop
Drops the separate 100ms useExitChord poller. useGamepad already reads every
pad each frame and knows when the game owns input, so it now fires a
gamepad:exitchord window event after a 1.5s Select+Start hold, only while
playing with no overlay open. Stream and Desktop listen for it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 22:32:56 -04:00
Georges-Antoine Assi
bc483bfdb8 Address Greptile and Copilot review on the pair shells
Pin PairShell's foreground and border tokens to the overlay palette so
the Pair card and footer stay legible in v2-light, let the footer's
version tag wrap long branch names instead of clipping, and drop the
footer positioning comments.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 22:32:34 -04:00
Sam Dornan
76a14954da docs: recommend pytest-xdist for local backend test runs (#4983) 2026-09-30 22:06:00 -04:00
Claude
258b87de0d fix: satisfy mypy and isort, and trim comments
The reaper test now reads HOLD_CEILING_SECONDS from handler.streaming.config,
where it is defined. Merges the duplicate handler.auth.base_handler imports
the rewrite left in two test files, and shortens the comments on the hold
ceiling, the LaunchBox spec and the registry module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh1SRMfuK7BZmf6YxMqSyT
2026-10-01 01:44:09 +00:00
Claude
103c59e9c0 fix: keep a consumer on the streaming queue when streaming is off
config.yml is re-read on every request, so streaming can be turned on
without a restart, and exit save pulls queued before it was turned off
still need a worker. With streaming off at boot, the general RQ worker
now listens on the streaming queue too instead of leaving it without a
consumer; the dedicated streaming worker still starts only when
streaming is on.

The check reads the exit status inline rather than through a function
in an `if !`, which shellcheck flags (SC2310) since it disables errexit.

Adds a fresh-interpreter test that init_sentry() never imports the SDK
without a DSN, and drops a comment that restated the PR's rationale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh1SRMfuK7BZmf6YxMqSyT
2026-10-01 01:40:44 +00:00
Sam Dornan
b5b0de02ab fix(tests): give each event loop its own fake async Redis client (#4979) 2026-09-30 21:36:38 -04:00
Claude
1e6dd1a2ac perf: keep task code out of the cron scheduler and idle RQ workers
The registry imported every task module to read each task's title,
schedule, queue and timeout, so `rq cron` and every RQ worker parent
loaded the whole app. Task metadata now lives in the registry as
`TaskSpec`s with a dotted path to the implementation, which `get_task`
imports only when a job runs. Cron, the tasks API, enqueueing and the
worker's failure reporting read specs only.

Every log line also imported handler.metadata.base_handler, and with
it every metadata provider, for the redaction regex. The sensitive keys
and their regex now live in logger.formatter.

A test pins that importing the cron config or the worker class loads
neither handler.database, the auth handlers nor fastapi.

Measured RSS at LOGLEVEL=INFO, master -> this branch:
- rq cron: 164 MB -> 72 MB
- idle RQ worker (x3): 133 MB -> 68 MB
- gunicorn web worker: 214 MB -> 206 MB

Each job's work horse now imports its task module itself, 0.1-0.5s
more per job on an x86 host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh1SRMfuK7BZmf6YxMqSyT
2026-10-01 01:32:21 +00:00
Georges-Antoine Assi
0f5f4e09ad Make gallery selection keyboard and screen reader friendly
The card and list row stay links. While the gallery is selecting they
describe their state (Selected / Not selected), Space toggles them, and
aria-keyshortcuts names the Ctrl/Cmd+Enter gesture that starts selecting.

The checkbox drawn on each item is now decorative: RCheckbox gains a
decorative mode that renders the box without an input or label, so it
is no longer a hidden tab stop or interactive content inside a link.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 21:20:11 -04:00
Claude
dd3b0a6f99 perf: stop loading the auth and web stack in background processes
Importing any handler.auth submodule ran the package __init__, which
built the auth handlers and so loaded authlib, joserfc and Socket.IO.
models.user imports handler.auth.constants, so every process that
touched the models paid for the whole auth stack. The handler
instances now live next to their classes in handler.auth.base_handler.

utils.context imported fastapi only for annotations; that import now
sits under TYPE_CHECKING.

An idle RQ worker drops from about 118 MB to 89 MB RSS. Each job's
forked work horse now imports a little more on its own, about 0.2s
on an x86 host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh1SRMfuK7BZmf6YxMqSyT
2026-10-01 01:02:37 +00:00
Georges-Antoine Assi
06b8a04070 Render the v2 pair page and share the auth footer
/pair only had a default view, so the v2 named router-view rendered
nothing and the QR pairing link opened a blank page. Give it a v2 view
like /pair/device and drop PairDispatcher.

Move the language selector and version tag bar into AuthFooter, used by
the sign-in layout and both pair shells.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 20:46:52 -04:00
Georges-Antoine Assi
3aba36d18b pr-ready: humanizer pass on comments
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 20:35:30 -04:00
Georges-Antoine Assi
380017b9fa pr-ready: apply simplify cleanups
Collapse the pair shells' footer into one flex row like AuthLayout's,
and name the list row's title and checkbox label once.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 20:31:15 -04:00
Georges-Antoine Assi
554ddeffcc pr-ready: apply code-review fixes
Keep the pair shells' footer out of the grid flow, label the bottom nav
landmark, name list-row checkboxes, reveal a keyboard-focused card
checkbox, drop aria-pressed from static cards that are not toggles, and
round the circular progressbar's aria-valuenow.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 20:28:32 -04:00
Sam Dornan
6cf38d6d25 fix(tools): make generate_test_data work on PostgreSQL (#4978) 2026-09-30 20:06:29 -04:00
Sam Dornan
5d93201874 feat(search): rank multi-word searches by phrase on PostgreSQL (#4977) 2026-09-30 20:05:43 -04:00
Sam Dornan
fb553b3409 refactor(db): escape LIKE searches with SQLAlchemy's autoescape (#4976) 2026-09-30 20:02:19 -04:00
Claude
78379718c7 perf: trim idle memory of the backend processes
Skip sentry_sdk.init when no SENTRY_DSN is set. Without a DSN the SDK
reports nothing, yet init still loads every default integration (httpx,
rich, jinja2, mako, pygments...), about 10 MB per process.

Import alembic.config only in main.py's __main__ block, the one place
that uses it, instead of in every gunicorn worker (about 8 MB).

Don't start the RQ streaming worker when config.yml leaves streaming
off (the default). It only runs streaming teardowns and exit save pulls,
and costs about 115 MB idle.

Measured on a gunicorn worker importing main: 213 MB -> 193 MB RSS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh1SRMfuK7BZmf6YxMqSyT
2026-09-30 23:54:42 +00:00
Sam Dornan
fed6fc9172 refactor(db): follow-ups to the derived-state fixes (#4969) 2026-09-30 19:00:30 -04:00
Sam Dornan
6941de13db Remove unused code and deduplicate copied helpers (#4975) 2026-09-30 18:51:36 -04:00
Zach Clendenen
a2948ee280 fix(streaming): address Greptile review on the desktop pad handoff
Require a release before a held Select+Start can fire again, so cancelling
the exit dialog with the chord still held no longer reopens it. Guard the
late desktop claim with useIsAlive instead of a local unmount flag.
2026-09-30 17:24:31 -05:00
Zach Clendenen
67f1d73d3f docs(streaming): review-polish pass on the desktop pad handoff
Trim the new comments on useExitChord, usePlayingWhile and the desktop
view to the one fact each needs.
2026-09-30 16:37:09 -05:00
Zach Clendenen
4675b87f03 refactor(streaming): simplify pass on the desktop pad handoff
Add usePlayingWhile next to useStageActive so both stream views mirror
their session into the playing flag, and clear it on dispose, through one
helper instead of a hand-wired watch and unmount reset each.

useExitChord reads the shared PAD_BUTTON names and skips disconnected
phantom pads via isUsablePad. A late desktop claim goes back through
release() rather than a second hand-written release call, and the desktop
tests share one claim fixture and release assertion.
2026-09-30 16:32:49 -05:00
Zach Clendenen
28fbeb8c04 fix(streaming): code-review pass on the desktop pad handoff
With useGamepad muted for the whole desktop session, B no longer reached
the exit confirmation, leaving a pad-only admin with no way out. Move the
player's Select+Start hold into a useExitChord composable and use it in
both views, including while the claim is loading.

A claim that answers after the view has gone is now released straight
away instead of standing unrenewed until it goes stale. Tests cover the
flag while loading, the drop on exit, the exit hold and the late claim.
2026-09-30 16:19:32 -05:00
Georges-Antoine Assi
1bcc1401ad Merge pull request #4963 from rommapp/chore/renovate-hold-typescript-7
chore(deps): update typescript to 6.0.3 and hold below 7
2026-09-30 17:18:00 -04:00
Zach Clendenen
36cd73762d fix(streaming): let the desktop session own the controller
The desktop view never set the global playing flag, so useGamepad kept
translating pad presses into RomM navigation behind the stream: B popped
history (prompting to end the session), the D-pad moved focus and Start
opened the user menu while an admin configured the emulator. Hold the flag
while the desktop is opening or open, as the game player does.
2026-09-30 16:06:12 -05:00