Skip to content

fix(api): add AbortSignal.timeout to unprotected fetch calls#825

Open
NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
NewCoder3294:fix/fetch-timeout-safety
Open

fix(api): add AbortSignal.timeout to unprotected fetch calls#825
NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
NewCoder3294:fix/fetch-timeout-safety

Conversation

@NewCoder3294
Copy link
Contributor

Summary

  • Add AbortSignal.timeout(15_000) to the two unprotected fetch() calls in server/worldmonitor/research/v1/list-tech-events.ts (ICS and RSS background fetches)
  • Add AbortSignal.timeout(15_000) to the unprotected fetch() call in server/worldmonitor/displacement/v1/get-displacement-summary.ts (UNHCR Population API)
  • These were the only fetch() calls in server/worldmonitor/ without a signal option; all other fetches already had timeout protection

Files modified

File Timeout Rationale
server/worldmonitor/research/v1/list-tech-events.ts 15_000 (15s) ICS calendar + RSS feed — heavy payloads
server/worldmonitor/displacement/v1/get-displacement-summary.ts 15_000 (15s) UNHCR JSON API — large paginated dataset

Test plan

  • Verify list-tech-events still returns results when ICS/RSS sources are reachable
  • Verify list-tech-events gracefully handles timeout (Promise.allSettled already handles rejection)
  • Verify get-displacement-summary still returns UNHCR data normally
  • Verify get-displacement-summary returns null on timeout (existing try/response check handles it)
  • Run npm run typecheck — confirmed passing

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 2, 2026

@NewCoder3294 is attempting to deploy a commit to the Elie Team on Vercel.

A member of the Team first needs to authorize it.

@koala73 koala73 added Ready to Merge PR is mergeable, passes checks, and adds value High Value Meaningful contribution to the project labels Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Value Meaningful contribution to the project Ready to Merge PR is mergeable, passes checks, and adds value

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants