audiobookshelf/test/server/controllers
D. Rimron-Soutter b58ddaf9d3 fix: Handle duplicate series name error on rename instead of crashing
PATCH /api/series/:id with a name that already exists in the same library
causes an unhandled SequelizeUniqueConstraintError that crashes the server
process (exit code 1). Wrap the save() call in try/catch and return 400.

The included test "should return 400 when renaming to a name that already
exists in the same library" also serves as a minimal reproducer for the bug:
run it against the unpatched SeriesController and it throws the unhandled
SequelizeUniqueConstraintError (the same error seen in production as a fatal
unhandled rejection at SeriesController.js:83).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:01:38 +00:00
..
LibraryItemController.test.js Update LibraryItemController unit test 2025-07-07 16:26:17 -05:00
MeController.test.js Auto format 2026-03-08 17:25:52 -05:00
SeriesController.test.js fix: Handle duplicate series name error on rename instead of crashing 2026-03-11 14:01:38 +00:00