Skip to content

fix: add request timeout to prevent indefinite loading#2777

Merged
veloce merged 1 commit intolichess-org:mainfrom
lacostej:fix/http-request-timeouts
Mar 16, 2026
Merged

fix: add request timeout to prevent indefinite loading#2777
veloce merged 1 commit intolichess-org:mainfrom
lacostej:fix/http-request-timeouts

Conversation

@lacostej
Copy link
Copy Markdown
Contributor

@lacostej lacostej commented Mar 16, 2026

Summary

  • Adds a 15-second default timeout to all HTTP requests in LichessClient.send()
  • Prevents screens from getting stuck in loading state when requests hang indefinitely (e.g. friends screen)

The timeout is applied at the LichessClient layer, so it covers all API requests without needing per-call configuration. The timeout is a static const that can be referenced if specific calls need to document why they override it.

Test plan

  • All existing tests pass (743/743)
  • Verify friends screen loads or shows error within 15 seconds on poor network
  • Verify normal API calls are unaffected by the timeout

EDIT: (maintainer)
I removed the issue marked as fixed.

Adds a default request timeout in LichessClient.send() to prevent
requests from hanging indefinitely, which can cause screens to stay
stuck in loading state (e.g. friends screen).

Fixes lichess-org#2724
@veloce veloce merged commit 1f051f3 into lichess-org:main Mar 16, 2026
1 check passed
@veloce
Copy link
Copy Markdown
Contributor

veloce commented Mar 16, 2026

I merged it because it is good to have a global timeout. But I don't think it fixes the loading issue in friends screen. As I understand the issue the server returns data, so we may have another problem in the app.

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.

2 participants