Explorar o código

[Auth] Fix 'PhoneAuthProviderFake.swift' following Swift 6 changes (#14895)

Nick Cooke hai 10 meses
pai
achega
e5933a02c2

+ 7 - 6
.github/workflows/combine.yml

@@ -33,12 +33,13 @@ on:
     # Rebuild on Ruby infrastructure changes.
     - 'Gemfile'
 
-    # Dependencies (Disabled to avoid building Firestore in presubmits)
-    # - 'FirebaseCore/**'
-    # - 'FirebaseAuth/**'
-    # - 'FirebaseFunctions/**'
-    # - 'Firestore/**'
-    # - 'FirebaseStorage/**'
+    # Dependencies
+    - 'FirebaseCore/**'
+    - 'FirebaseTestingSupport/**'
+    - 'FirebaseAuth/**'
+    - 'FirebaseFunctions/**'
+    - 'FirebaseStorage/**'
+    # - 'Firestore/**' # (Disabled to avoid building Firestore in presubmits)
 
   schedule:
     # Run every day at 11pm (PST) - cron uses UTC times

+ 3 - 3
FirebaseTestingSupport/Auth/Sources/PhoneAuthProviderFake.swift

@@ -16,16 +16,16 @@
 import Foundation
 
 /// A fake object to replace a real `AuthAPNSTokenManager` in tests.
-public class PhoneAuthProviderFake: PhoneAuthProvider {
+public class PhoneAuthProviderFake: PhoneAuthProvider, @unchecked Sendable {
   override init(auth: Auth) {
     super.init(auth: auth)
   }
 
-  var verifyPhoneNumberHandler: (((String?, Error?) -> Void) -> Void)?
+  var verifyPhoneNumberHandler: ((@MainActor (String?, Error?) -> Void) -> Void)?
 
   override public func verifyPhoneNumber(_ phoneNumber: String,
                                          uiDelegate: AuthUIDelegate? = nil,
-                                         completion: ((_: String?, _: Error?) -> Void)?) {
+                                         completion: (@MainActor (String?, Error?) -> Void)?) {
     if let verifyPhoneNumberHandler,
        let completion {
       verifyPhoneNumberHandler(completion)