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

Automatically retry on 9403 Invalid token #26

Closed
eai04191 opened this issue Sep 28, 2022 · 4 comments
Closed

Automatically retry on 9403 Invalid token #26

eai04191 opened this issue Sep 28, 2022 · 4 comments
Labels
enhancement New feature or request Nintendo Switch Online Related to the Nintendo Switch Online app APIs

Comments

@eai04191
Copy link

image

I don't know if it's because of the server or the network/ISP I'm using, but the nxapi-app often fails to get the token and creates a dialog each time.
This can happen several times an hour, and pressing retry does nothing wrong, but it's annoying.
Retrying automatically for retryable errors and popping up the error only if it still can't be recovered would improve the experience.
Thanks.

@samuelthomas2774 samuelthomas2774 added the Nintendo Switch Online Related to the Nintendo Switch Online app APIs label Oct 9, 2022
@samuelthomas2774
Copy link
Owner

This is because of the changes to the f token validation a few weeks ago:

As this token is generated in a native library in the official app no one really knows how it works, and there must still be something else that changed that's causing imink/flapg/nxapi/nsotokengen to sometimes not generate valid tokens.

I have thought about retrying automatically once for this as that usually works, but a few people have reported requiring a lot more attempts before authenticating works. Unless I or someone else figures out a better fix I'll probably still do this for the app, but that doesn't really fix the issue here.

This can happen several times an hour, and pressing retry does nothing wrong, but it's annoying.

This should only happen every 2 hours (for each account with active monitors) as that's how long the token is valid for. Is this happening more frequently for you?

@samuelthomas2774 samuelthomas2774 changed the title "[znc] Invalid Token" error pops up often Automatically retry on 9403 Invalid token Oct 9, 2022
@samuelthomas2774 samuelthomas2774 added the enhancement New feature or request label Oct 9, 2022
@ShiroBlank
Copy link

ShiroBlank commented Oct 16, 2022

I'm facing the same issue, but in addition I am also seeing an error popup constantly when having auto refresh enabled (and disabled).
image
auto-retrying all these errors would be a great QOL change.

@samuelthomas2774
Copy link
Owner

I actually just added EAI_AGAIN as an error code it will auto-retry for yesterday (02e49a9). Let me know if you see any other codes for temporary errors. All errors for the main window refreshes already just appear as a warning icon, the error dialog is just for friend notifications/Discord presence.

For the 9403 Invalid token errors: @JoneWang is updating the imink API later to hopefully try to resolve the issue of f tokens often being rejected. If this helps I'd prefer not to auto retry on those errors in case Nintendo makes any changes to the API again.

@samuelthomas2774
Copy link
Owner

Closing as issues with f token generation from 23/08/2022 appear to be resolved now.

Handling of errors updating presence data will be moved to #41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Nintendo Switch Online Related to the Nintendo Switch Online app APIs
Development

No branches or pull requests

3 participants