Files
romm/backend
Spinnich 00b894733d fix(roms): return 404 when content file_ids match no files
Renaming a ROM gives its file a new internal id, but the EmulatorJS
player keeps a remembered file id ("disc") in localStorage and reuses
it on the next launch. After a rename that id is stale, so the content
download endpoint matched zero files and fell through to its multi-file
ZIP path, producing a download whose only entry was an empty .m3u
playlist. nginx's mod_zip decode step rejects the blank value (HTTP
400) and aborts the response, sending 0 bytes — which EmulatorJS
surfaces as a generic "network error" (issue #3470).

The frontend half (validating the remembered disc against the ROM's
current files) already landed on master in d1696cd04. This is the
backend half: when no files match the request, raise a clean 404
instead of building a broken empty-.m3u ZIP. This also covers a ROM
with zero files.

Add endpoint tests (auth, single-file, valid file id, stale file id
-> 404, missing rom -> 404) plus a `rom_file` fixture.

Written primarily by Claude Code.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 14:14:25 +00:00
..
2026-06-01 17:19:57 -04:00
2026-02-09 17:26:21 -05:00
2026-06-01 17:19:57 -04:00
2026-05-20 09:17:35 -04:00
2026-05-29 20:54:32 -04:00
2026-02-03 17:09:21 -05:00
2025-08-02 17:55:43 -04:00
2026-05-30 20:26:29 -04:00
2026-05-17 17:39:47 -04:00
2026-05-22 22:35:30 -04:00