-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Retry for invalid_grant errors - Silent Iframe #7218
Conversation
lib/msal-browser/test/interaction_client/SilentIframeClient.spec.ts
Outdated
Show resolved
Hide resolved
lib/msal-browser/test/interaction_client/SilentIframeClient.spec.ts
Outdated
Show resolved
Hide resolved
I wonder if we should log a flag to telemetry to explicitly indicate a retry was performed? Or is it preferable to determine this by building queries with the existing data? I expect this will have big perf implications if this is done at scale and it might be nice to have an easy way to track this. Just a suggestion but I'll leave that up to you and @konstantin-msft |
All of these retries need an explicit indicator in telemetry that they are happening. It would likely be helpful to log the error returned for both the original call (invalid grant today, possibly others in the future?) as well as the retry result. |
It makes sense to add a new telemetry data point that indicates a retry was performed. Error codes, in turn, are captured in the "context" field for each instrumented function. However, there are two scenarios here:
|
Thanks for the input, all! I added a new data point. Let me know if you prefer a different name. |
Co-authored-by: Thomas Norling <thomas.norling@microsoft.com>
e instanceof ServerError && | ||
e.errorCode === BrowserConstants.INVALID_GRANT_ERROR | ||
) { | ||
if (!authClient) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional. You can simplify nested if
conditions by joining them together into if (!authClient || !(e instanceof ServerError) || e.errorCode !== BrowserConstants.INVALID_GRANT_ERROR) { then throw e }
so you won't need else
.
First of 3 PRs addressing need for retry for backup auth service.