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

Better handle network errors such as disconnect / rate limiting. #63

Closed
nijikokun opened this issue Jun 24, 2018 · 3 comments
Closed

Better handle network errors such as disconnect / rate limiting. #63

nijikokun opened this issue Jun 24, 2018 · 3 comments

Comments

@nijikokun
Copy link
Collaborator

nijikokun commented Jun 24, 2018

See #57 for more in-depth details.

  • 429 currently cause zero values due to items being returned as empty array.
  • Network disconnects currently break the requester, which brick the app.

Fixes being implemented:

  • 429 now return { status: 429 } so requester can properly debounce queue requests to window timeout
  • Network is checked inside of requester threads and queues are debounced when offline.

Future features:

  • Notification when network is out
  • Check for network on start so you don't have to re-login

Simulation of 429s with console logging on threads:

image

@nijikokun
Copy link
Collaborator Author

nijikokun commented Jun 24, 2018

Adding another precaution since reloading the application while rate limited was very destructive previously:

image

Note this screen will only show if you close the app and re-open while rate-limited, it also does a count-down so you get a visual cue of how many seconds are left.

@nijikokun
Copy link
Collaborator Author

nijikokun commented Jun 24, 2018

So what happens in beta.9 when you encounter a rate limit?

  • Data is returned as empty to the requester.
  • Requester sees this, caches it, a portfolio report is built with empty data.
  • Reloading while rate-limited causes the application to think you have no tabs
    • This makes it unable to update portfolios
    • Portfolios also zero value out because you are still rate limited.

What will happen in the next release?

  • A status report is thrown to the requester
    • Requester debounces the queue based on the timeout interval
    • When it requests again, if it gets another rate-limit it does the debounce again until requests 200 again.
  • When you reload and you are rate-limited

@nijikokun
Copy link
Collaborator Author

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

No branches or pull requests

1 participant