Closed erichoracek closed 5 months ago
Hi @erichoracek, thanks for raising this.
Would you happen to have any additional contextual information on this issue? For example, in this instance, it happened when the login button was rapidly tapped twice while the app window was not active yet.
Hi @Widcket, we don't have a lot of information since we can't reproduce these crashes, but both of these appear to about 5-10 seconds after a SFBrowserRemoteViewController
is dismissed as part of user login.
Unfortunately, without more information, there's not much we can do. I'm no longer the maintainer of this library, so I cannot dedicate more time to look into this.
We are in the same situation—we're unable to reproduce this locally. Since the crash is clear about the cause I'd assume it should be possible to make a fix by storing some state locally and checking it to ensure the continuation is invoked once, even if we don't know the root cause or have a repro case.
I think I managed to reproduce it:
https://github.com/auth0/Auth0.swift/assets/5055789/b0adccea-8469-416c-8004-15337111748d
If this is is the same crash (please check in your crash reports) then it's due to a race condition because of the two login transactions happening at the same time.
The above happens when tapping two of the login buttons at the same time (e.g. Google login and email/password login) logging in in one of the browser modals, and then very quickly pressing cancel on the second as soon as the first is dismissed.
As a race condition, it doesn't happen all the time, and is hard to get just right.
It shouldn't be possible to open two browser modals at the same time, though.
Checklist
Description
We have seen two crashes in the Auth0 SDK with
SWIFT TASK CONTINUATION MISUSE
.These crashes occur on the order of 1-20 times per day in our app in production, as reported by Sentry.
Here are the two relevant stack traces:
Crash 1: Auth0WebAuth.swift:175
Crash 2: OAuth2Grant.swift:91
Reproduction
These crashes are not easily reproducible, we have only discovered them via production crash logs.
Additional context
No response
Auth0.swift version
2.5.0
Platform
iOS, iPadOS
Platform version(s)
iOS 16-17
Xcode version
15.1
Package manager
Swift Package Manager