-
Notifications
You must be signed in to change notification settings - Fork 327
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
Replace withCheckedThrowingContinuation Calls With withUnsafeThrowingContinuation #4286
Conversation
@RCGitBot please test |
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.
We could probably follow up with a check to only use this version in iOS 18. Hopefully we wouldn’t have to live with it for too long in any case
return try await withCheckedThrowingContinuation { continuation in | ||
return try await withUnsafeThrowingContinuation { continuation in |
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.
let’s add a comment pointing to the issue for future reference
@fire-at-will thanks for taking care of this! |
@kristofferbv thanks so much for reporting back! I've updated the branch to replace all instances of |
Thanks! It works now with the latest changes. It would be really helpful if you could merge this branch into main. |
@RCGitBot please test |
@kristofferbv thanks for confirming! Merging to main now, will go out in the next release, likely today or tomorrow |
…Continuation (#4286) * replace withCheckedThrowingContinuation calls with withUnsafeThrowingContinuation * replaced instances of withCheckedContinuation -> withUnsafeContinuation * update the links in comments to point to the issue not the PR * linting --------- Co-authored-by: andy boedo <andresboedo@gmail.com>
…Continuation (RevenueCat#4286) * replace withCheckedThrowingContinuation calls with withUnsafeThrowingContinuation * replaced instances of withCheckedContinuation -> withUnsafeContinuation * update the links in comments to point to the issue not the PR * linting --------- Co-authored-by: andy boedo <andresboedo@gmail.com>
Motivation
iOS 18 introduces a bug in Swift that causes calls to
withCheckedThrowingContinuation
to crash in certain scenarios. This PR provides some promise in addressing this issue, documented in #4177Description
This PR replaces all calls to
withCheckedThrowingContinuation
towithUnsafeThrowingContinuation
, which we're unable to reproduce the issue with.Other Notes
withUnsafeThrowingContinuation
doesn't provide any checking to ensure that the continuation isn't called multiple times, so this is something we'll need to be aware of going forward. Luckily, all existing usages ofwithCheckedThrowingContinuation
were in just a few files and in small functions, so this is easy to check manually for now.