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

At startup Feishin still sends api requests with invalid token even after refreshing token causing server to send 429 #403

Closed
ajh657 opened this issue Dec 7, 2023 · 0 comments · Fixed by #510
Labels
bug Something isn't working

Comments

@ajh657
Copy link

ajh657 commented Dec 7, 2023

Expected Behavior

Feishin should not send api requests with old invalid token and kick out out to the server selector.

Current Behavior

Here is the order of requests that happens when starting Feishin when the Navidrome token is expired.

Request Token Status
GET /api/album x4 Expired Token 401
Login/Auth New Token n1 200
GET /api/album New Token n1 200
GET /api/album x3 Expired Token 401
Login/Auth New Token n2 200
GET /api/album New Token n2 200
GET /api/album x2 Expired Token 401
Login/Auth New Token n3 200
GET /api/album New Token n3 200
GET /api/album Expired Token 401
Login/Auth No token returned 429

DevTools Network tab:
image

DevTools Console tab:
image

Steps to Reproduce

Axios error stack :

"AxiosError: Request failed with status code 429 at file:///C:/Users/hoyla/AppData/Local/Programs/feishin/resources/app.asar/dist/renderer/renderer.js:2304:112574 at XMLHttpRequest.h (file:///C:/Users/hoyla/AppData/Local/Programs/feishin/resources/app.asar/dist/renderer/renderer.js:2304:112719)"
  1. Wait for the navidrome token to expire
  2. Startup Feishin
  3. Quickly open DevTools to start the logging of Network requests
  4. Feishin kicks you to the server selector
  5. look in the Devtools network and console

Possible Solution (Not obligatory)

i think it has to do with the old token not qetting cleared or the old requests not being canceled when the new token is gotten.

Context

This is mostly a minor annoyance. It would be nice to have this fixed for a smoother experience with Feishin not having to relog into my server everyday.

Your Environment

Navidrome Docker environment variables:

      ND_SCANSCHEDULE: 1h
      ND_LOGLEVEL: info
      ND_SESSIONTIMEOUT: 24h
  • Application version (e.g. v0.1.0) : 0.5.2
  • Operating System and version (e.g. Windows 10) : Windows 11
  • Server and version (e.g. Navidrome v0.48.0) : Raspberry pi with Navidrome 0.49.3 (8b93962f) in docker container file
  • Node version (if developing locally) :
@ajh657 ajh657 added the bug Something isn't working label Dec 7, 2023
kgarner7 added a commit to kgarner7/feishin that referenced this issue Feb 16, 2024
Resolves jeffvli#403.
This PR introduces a startup check for Navidrome that tries a simple API request (/songs) before loading homepage.
If the check fails, Navidrome API will fallback to trying saved password (if available).

Notes:
- It might also be worthwhile to do a periodic poll?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant