Files
romm/backend/handler
Georges-Antoine Assi e36d7646b2 feat(saves): scope save discovery to a set of ROM IDs
Sync clients that hold a subset of the library had no bounded way to ask
for the saves relevant to the ROMs on the device: `GET /api/saves` filters
one ROM at a time, and negotiation always evaluated the user's whole
slotted save set, offering downloads for ROMs the device cannot play.

Add a `rom_ids` scope to both. `GET /api/saves` takes a comma-separated
list (matching the `/roms/download` convention) and `POST /api/sync/negotiate`
takes a list in the request body, so a client with many ROMs is not bound by
URL length. Negotiation widens the scope with the ROMs the client sent saves
for, so a client save is never misread as an upload because its ROM was
omitted. The scope is read-only: an omitted ROM is outside the request, never
a deletion signal.

Both share one limit and one validation rule in the saves handler, and both
reject a scope that is non-positive or over the cap rather than truncating.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 15:44:44 -04:00
..
2025-12-07 12:19:13 -05:00