Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle 404 server responses graciously #57

Open
BlueNalgene opened this issue Feb 23, 2024 · 1 comment
Open

Handle 404 server responses graciously #57

BlueNalgene opened this issue Feb 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@BlueNalgene
Copy link

If Power Ampache 2 is logged in to a server which experiences major changes (I deleted the test server), it gets stuck in a 404 loop when interacting with the app again.

Steps to recreate:

  • Create an example server
  • Login to server with app
  • Destroy server instance
  • Attempt to logout with app

Results in:

``HTTP 404 Not Found'' errors several times per second. The logs are full of spam like:

2024-02-23 11:07:21
HTTP 404 Not Found

2024-02-23 11:07:21
getAlbumsStats() - cannot load data HttpException retrofit2.HttpException: HTTP 404 Not Found

2024-02-23 11:07:21
HTTP 404 Not Found

2024-02-23 11:07:21
getAlbumsStats() - cannot load data HttpException retrofit2.HttpException: HTTP 404 Not Found

and so on.

What does not work to fix:

  • App force stop does not clear the app info, and when the app is re-opened, the loop resumes.
  • Attempting to log out sends the API logout call ad infinitum. There seems to be no way to stop this process once it has begun.

What should happen:

The app should have a way to gracefully exit after a 404 loop is encountered. Logout attempts which result in 404 should result in a single error before stopping the logout process.

Quick Fix for Users

Remove and re-install the app.

@icefields
Copy link
Owner

thanks for reporting.
I don't think the problem is with the server experiencing major changes, from what I see from the logs, there is an issue connecting, that I think would happen regardless of the server changes (would happen every time the app cannot connect to server, regardless of the updates on the backend).
I also suspect that's not a loop, but instead a finite number of calls that fail every time (but I need to look into this to confirm). When a user re-enters the app there is an attempt to refresh all the data, that triggers at least 8 calls (session call, user info, recent albums, newest, most played, favourites, etc...), which in your case are all failing because there is an issue connecting to the server. The big numbers of calls failing might make it look like a loop.
Anyway, the app should definitely handle server errors graciously. I'm going to look into this.

@icefields icefields changed the title Server Change 404 Loop Handle 404 server responses graciously Feb 23, 2024
@icefields icefields self-assigned this Feb 25, 2024
@icefields icefields added bug Something isn't working enhancement New feature or request labels Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants