Skip to content

fix: add request timeout to all fetch calls#2243

Open
nyxsky404 wants to merge 1 commit into
janavipandole:mainfrom
nyxsky404:fix/fetch-timeout
Open

fix: add request timeout to all fetch calls#2243
nyxsky404 wants to merge 1 commit into
janavipandole:mainfrom
nyxsky404:fix/fetch-timeout

Conversation

@nyxsky404

@nyxsky404 nyxsky404 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

📄 Description

All fetch() calls in contributors.js, login.js, and register.js had no timeout, so a slow or unresponsive server would leave users with a permanently spinning UI.

  • Added js/fetch-timeout.js — a shared fetchWithTimeout(url, options, ms=10000) helper that wraps fetch() with an AbortController and a configurable timeout (default 10 s).
  • Replaced every bare fetch() call in the three affected files with fetchWithTimeout().
  • Loaded js/fetch-timeout.js before the consumer scripts in contributors.html, login.html, and register.html.

🔗 Related Issues

Fixes #2238

🧩 Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change
  • Documentation update

✅ Checklist

  • Code follows project styling guidelines
  • Changes are fully responsive and accessible
  • No extraneous logs or debug code left
  • Documentation updated accordingly
  • Built successfully locally
  • Console has zero errors or warnings

Bare fetch() calls had no timeout, leaving users with a
permanently spinning UI if the server or GitHub API was slow.
Added js/fetch-timeout.js with a reusable fetchWithTimeout()
(default 10 s via AbortController) and wired it into
contributors.js, login.js, and register.js.
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

@nyxsky404 is attempting to deploy a commit to the janavipandole's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Login and registration fetch() calls have no timeout — users hang indefinitely when API is slow or unreachable

1 participant