mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
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>