[MEDIUM] Add fetch timeout with AbortController in API layer #40

Closed
opened 2026-06-09 00:03:13 +00:00 by Mark · 0 comments
Owner

Location: src/lib/api.ts:35-59

Problem: fetchApi() calls native fetch() with no timeout. Hanging requests block the UI indefinitely on network stalls.

Impact: Users stuck on loading spinners with no recovery.

Fix:

const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 10000);
const response = await fetch(url, { ...options, signal: controller.signal });
clearTimeout(timeout);

Effort: ~20 mins

**Location:** `src/lib/api.ts:35-59` **Problem:** `fetchApi()` calls native `fetch()` with no timeout. Hanging requests block the UI indefinitely on network stalls. **Impact:** Users stuck on loading spinners with no recovery. **Fix:** ```ts const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), 10000); const response = await fetch(url, { ...options, signal: controller.signal }); clearTimeout(timeout); ``` **Effort:** ~20 mins
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/subvault#40
No description provided.