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

Crash on CheckedContinuation using await Credential.refreshIfNeeded() #170

Closed
baksha97 opened this issue Feb 9, 2024 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@baksha97
Copy link

baksha97 commented Feb 9, 2024

Describe the bug?

Multiple concurrent callers to await Credential.refreshIfNeeded() will crash the app.

What is expected to happen?

No crash, all results for the refresh are provided to the callers only once.

What is the actual behavior?

CheckedContinuations fail due to trying to resume to a continuation more than once.
image

Reproduction Steps?

Use withThrowingTaskGroup to concurrently call this function. If a refresh is needed, it will be performed and ultimately crash the app.

Additional Information?

No response

SDK Version(s)

All

Build Information

No response

@baksha97 baksha97 added the bug Something isn't working label Feb 9, 2024
@baksha97 baksha97 changed the title Crashing using await Credential.refreshIfNeeded() Crashing on await Credential.refreshIfNeeded() Feb 9, 2024
@baksha97 baksha97 changed the title Crashing on await Credential.refreshIfNeeded() Crashing on CheckedContinuation using await Credential.refreshIfNeeded() Feb 9, 2024
@baksha97 baksha97 changed the title Crashing on CheckedContinuation using await Credential.refreshIfNeeded() Crash on CheckedContinuation using await Credential.refreshIfNeeded() Feb 9, 2024
@ericwelander
Copy link

We are seeing this issue as well
Code
StackTrace

@mikenachbaur-okta
Copy link
Contributor

Thank you for the feedback, this information is very helpful. I'll look into this, and will update the issue when I know more.

@mikenachbaur-okta
Copy link
Contributor

@baksha97 I've begun working on this, starting with a failing unit test to prove the root cause (All bugs identified in this project are fixed in a TDD-fashion). Once I complete a fix for this, you can see the results here.

@mikenachbaur-okta
Copy link
Contributor

@baksha97 @ericwelander I've merged #173 which addresses this fix. If you want to give it a try please feel free, otherwise I'll be publishing a new release soon, once I complete some other work that is currently in-flight.

I'll close this issue, but feel free to either re-open it, or file new tickets, if you experience other problems.

Also, if you have feedback or encounter bugs, please don't hesitate to file issues, since this is our primary mechanism for collecting developer feedback. We love hearing from our customers, and I personally would like to encourage you to let us know if there's anything we can do to improve these tools.

@ericwelander
Copy link

Your fix works for us. Thanks @mikenachbaur-okta!

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

No branches or pull requests

3 participants