fix: 25s backend timeout + 30s frontend timeout on Spotify resolve

Extracts resolve logic into _resolveSpotify() and wraps it in
Promise.race with a 25s timer so the backend always sends a response
even if undici's AbortSignal.timeout silently fails on blocked sockets.
Also reduces frontend timeout from 90s to 30s.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-09 23:39:07 +02:00
1 parent 7d38fdf601
commit 76271c1e54
2 files changed
+40 -46

No files matched your search

+1 -1
View File
@@ -63,7 +63,7 @@ export async function resolveSpotifyLink() {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url }),
signal: AbortSignal.timeout(90000),
signal: AbortSignal.timeout(30000),
});
if (!res.ok) {
const err = await res.json().catch(() => ({}));