byrongamatos
4825ad2e34
fix(career): bound the prepare request; validate the setlist (PR #971 review)
...
Both CodeRabbit findings were right.
1. A HUNG PREPARE COULD BLOCK THE GIG FOREVER.
`await fetch(...)` only rejects on a network ERROR. A server that accepts the
connection and then never answers hangs indefinitely — and the gig would never
start. That makes this optimisation the exact thing the PR promises it can
never be: the reason you cannot play.
The request is now bounded by an AbortController (PREPARE_TIMEOUT_MS, generous
because unpacking a setlist is real work — but a CEILING, not a wait). Past it
we start the gig and let the first play extract lazily, as it always did. The
Play button is restored in a `finally`, so a timeout cannot strand the poster
on "Preparing set…" with Play disabled — which would have been the same bug
wearing a different hat.
2. THE `songs` BODY WAS UNVALIDATED.
A str is iterable: "abc" would have prepared three one-character "songs". And
the endpoint unpacks zips, so an arbitrary caller could ask for unbounded work.
Now list-only, string entries, blanks dropped, capped at MAX_GIG_SONGS.
Tests: the fetch is abortable and the button is re-enabled on EVERY path
including the abort; non-list bodies, non-string/blank entries, and an
oversized setlist. 50 career tests, JS 5/5, eslint clean.
2026-07-15 00:18:56 +02:00
..
2026-07-11 16:33:03 +02:00
2026-06-16 18:47:13 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-16 18:47:13 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-07-12 14:22:19 +02:00
2026-07-05 23:50:30 +02:00
2026-07-10 23:19:20 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-07-11 18:18:00 +02:00
2026-06-23 11:03:01 +02:00
2026-07-14 16:54:08 +02:00
2026-06-23 11:03:01 +02:00
2026-07-02 18:42:26 +02:00
2026-07-12 13:43:57 +02:00
2026-07-05 23:37:39 +02:00
2026-07-15 00:18:56 +02:00
2026-07-10 23:19:20 +02:00
2026-06-23 11:03:01 +02:00
2026-06-29 15:31:24 +02:00
2026-07-05 22:20:32 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-22 12:08:22 +02:00
2026-06-16 18:47:13 +02:00
2026-07-10 23:19:20 +02:00
2026-06-22 13:27:21 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-16 18:47:13 +02:00
2026-07-02 00:40:52 +02:00
2026-06-16 18:47:13 +02:00
2026-07-10 23:19:20 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-07-01 02:59:51 -04:00
2026-07-12 12:24:40 +02:00
2026-06-23 11:03:01 +02:00
2026-07-12 12:31:56 +02:00
2026-07-12 12:31:56 +02:00
2026-07-12 13:00:29 +02:00
2026-07-11 19:22:14 +02:00
2026-07-10 23:19:20 +02:00
2026-07-12 12:24:40 +02:00
2026-07-12 13:00:29 +02:00
2026-07-14 22:11:52 +02:00
2026-07-10 23:19:20 +02:00
2026-07-10 23:19:20 +02:00
2026-07-12 12:24:40 +02:00
2026-07-12 13:00:29 +02:00
2026-07-10 23:19:20 +02:00
2026-07-11 20:58:41 +02:00
2026-07-11 22:44:03 +02:00
2026-07-12 00:19:59 +02:00
2026-06-16 19:36:53 +01:00
2026-07-03 14:35:07 +02:00
2026-07-13 00:35:09 +02:00
2026-07-11 21:32:31 +02:00
2026-07-12 11:56:07 +02:00
2026-06-23 11:03:01 +02:00
2026-07-12 16:06:28 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-07-11 23:26:35 +02:00
2026-07-02 20:50:56 +02:00
2026-07-03 13:07:47 +02:00
2026-07-11 23:26:35 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-07-11 18:18:00 +02:00
2026-07-12 00:19:59 +02:00
2026-07-12 00:19:59 +02:00
2026-07-11 18:18:00 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-06-23 11:03:01 +02:00
2026-07-11 22:44:03 +02:00
2026-07-11 20:58:41 +02:00
2026-07-12 14:08:45 +02:00
2026-07-12 16:05:50 +02:00
2026-07-12 14:22:19 +02:00
2026-07-11 22:05:22 +02:00
2026-07-12 11:56:07 +02:00
2026-07-11 21:52:51 +02:00
2026-07-11 23:26:35 +02:00
2026-07-12 14:22:19 +02:00
2026-06-16 18:47:13 +02:00
2026-06-23 11:03:01 +02:00
2026-07-12 14:22:19 +02:00
2026-06-16 18:47:13 +02:00
2026-07-11 19:37:44 +02:00
2026-07-11 19:37:44 +02:00
2026-06-28 13:58:14 +02:00
2026-07-02 14:03:05 +02:00
2026-06-29 10:42:41 +02:00
2026-07-02 14:52:40 +02:00
2026-07-03 14:35:07 +02:00
2026-07-11 23:30:30 +02:00
2026-06-28 14:10:15 +02:00
2026-06-28 12:39:13 +02:00
2026-06-29 12:26:29 +02:00
2026-07-11 19:37:44 +02:00
2026-07-05 00:19:46 +02:00
2026-07-02 13:57:58 +02:00
2026-06-29 14:44:56 +02:00
2026-07-13 15:07:28 +02:00
2026-06-16 18:47:13 +02:00
2026-06-23 11:03:01 +02:00
2026-07-14 22:11:52 +02:00
2026-07-14 22:11:52 +02:00
2026-07-11 18:41:52 +02:00
2026-06-23 11:03:01 +02:00
2026-07-11 17:09:18 +02:00
2026-07-01 11:07:58 +02:00
2026-07-05 00:16:42 +02:00