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

Many 401s #394

Open
rohdester opened this issue Aug 22, 2022 · 0 comments
Open

Many 401s #394

rohdester opened this issue Aug 22, 2022 · 0 comments

Comments

@rohdester
Copy link

I sometimes have issue were my app continues to call the backend API when getting a 401. Sometimes I end up getting many many 401s from a user in a very short time span.

I am using OAuths OAuth2DataLoader, but given these many 401s I am wondering if I am using it correctly.

I use it like so:

dataLoader.perform(request: req, retry: true) { response in
...
}

So retry is set to true. By reading the docs I understand that that means that if the response is 401, the request is enqueued and then retried when tokens have been refreshed.
So the request will not be retired until the user has been re-authrozied. Is that correctly understodd?

Also, I should mention that for each request I am constructing a new OAuth2DataLoader instance. And when the app becomes active, many dataloader instances are thus working at the "same time". Is that an issue? Should I use same OAuth2DataLoader instance across all requests?

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