Skip to content

fix: handle 5xx server errors with retry message in playback network#178

Merged
LargeModGames merged 1 commit into
mainfrom
spotify-api-504-timeout
Mar 20, 2026
Merged

fix: handle 5xx server errors with retry message in playback network#178
LargeModGames merged 1 commit into
mainfrom
spotify-api-504-timeout

Conversation

@LargeModGames
Copy link
Copy Markdown
Owner

This pull request primarily improves error handling for Spotify server errors in playback networking, and makes a minor import order fix in the test module. The most significant change is the addition of user-friendly messaging and retry logic for temporary Spotify server issues.

Playback network error handling improvements:

  • Added detection for Spotify server 5xx errors (502, 503, 504, "Gateway Timeout", "Service Unavailable", "Bad Gateway") in Network's playback error handling. When such an error is detected, a clear status message is shown to the user, and polling is automatically retried after a short delay, improving user experience during transient outages.

Test module cleanup:

  • Fixed the import order in the test module of src/core/app.rs by moving the test_helpers import to follow the module declaration, improving code organization.

Copilot AI review requested due to automatic review settings March 19, 2026 14:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves resiliency of playback polling by detecting Spotify server-side 5xx failures during me/player fetches and showing a user-facing “retrying” status message instead of surfacing the error immediately. It also performs a small test-module import reordering for cleanliness.

Changes:

  • Add special-case handling for Spotify 5xx (502/503/504 + reason phrases) during playback polling to show a retry status and avoid error escalation.
  • Reset playback polling timer on 5xx errors to trigger an automatic retry on the next poll interval.
  • Reorder imports in src/core/app.rs test module.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/infra/network/playback.rs Adds 5xx detection and user-friendly retry messaging in current playback polling error path.
src/core/app.rs Adjusts import ordering inside the #[cfg(test)] module.

Comment thread src/infra/network/playback.rs
Comment thread src/infra/network/playback.rs
Comment thread src/infra/network/playback.rs
@LargeModGames LargeModGames merged commit dd6e4d1 into main Mar 20, 2026
13 checks passed
@LargeModGames LargeModGames deleted the spotify-api-504-timeout branch March 20, 2026 11:14
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