Skip to content

Commit

Permalink
Remove erroneous assertion (#34)
Browse files Browse the repository at this point in the history
#31 adjusted the assertion during sending errors back, and reintroduced
the data race from canceling the autofill request due to starting a
modal one (explicitly returning a failure to the continuation, clearing
it out, and canceling the authController - which went back to sendError)

This removes the assertion, since it was logically unsound, not to
mention unhelpful. I've done another bunch of manual testing in a sample
app and can no longer reproduce the issue. I'm not sure how to cover
this in automated tests to prevent another regression, but I'll file a
ticket in case someone finds a way.
  • Loading branch information
Firehed authored Jul 28, 2024
1 parent 1613bd0 commit 0b3b920
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Sources/SnapAuth/SnapAuth+ASACD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ extension SnapAuth: ASAuthorizationControllerDelegate {

/// Sends the error to the appropriate delegate method and resets the internal state back to idle
private func sendError(_ error: SnapAuthError) {
// One or the other should eb set, but not both
assert(continuation != nil)
continuation?.resume(returning: .failure(error))
continuation = nil
}
Expand Down

0 comments on commit 0b3b920

Please sign in to comment.