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

[auth-swift] Property Swift optionality tests #11915

Merged
merged 4 commits into from
Oct 10, 2023
Merged

Conversation

paulb777
Copy link
Member

@paulb777 paulb777 commented Oct 9, 2023

  • Add Swift API tests for all public properties including testing the type and optionality
  • Fix uncovered issues in Swift implementation
  • Discovered three cases of the Objective C SDK setting nonnull properties to nil: UserInfo.providerID, AuthDataResult.signInSecondFactor, and MultiFactor.enrolledFactors
  • Restore FIRAuth.h typedefs to fix build issues in FirebaseUI
  • Remove static utility function userInfo in AdditionalUserInfo.swift since it didn't handle providerID optionality correctly. Callers now use the standard constructor
  • TODO: Write similar API tests for Objective C

#no-changelog

@google-oss-bot
Copy link

1 Warning
⚠️ New public headers were added, did you remember to add them to the umbrella header?

Generated by 🚫 Danger

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

Apple API Diff Report

Commit: 01ff610
Last updated: Mon Oct 9 17:22 PDT 2023
View workflow logs & download artifacts


FirebaseAuth

[ADDED] Constants
Swift:
+    static let AuthStateDidChange : NSNotification . Name
Objective-C:
+    extern NS_SWIFT_NAME ( AuthStateDidChange ) const NSNotificationName FIRAuthStateDidChangeNotification

Type Definitions

[ADDED] FIRAuthDataResultCallback
[ADDED] FIRAuthDataResultCallback
Objective-C:
+  typedef void ( ^ FIRAuthDataResultCallback )( FIRAuthDataResult * _Nullable , NSError * _Nullable )
[ADDED] FIRIDTokenDidChangeListenerHandle
[ADDED] FIRIDTokenDidChangeListenerHandle
Swift:
+  typealias IDTokenDidChangeListenerHandle = NSObjectProtocol
Objective-C:
+  typedef id < NSObject > FIRIDTokenDidChangeListenerHandle
[ADDED] FIRIDTokenDidChangeListenerBlock
[ADDED] FIRIDTokenDidChangeListenerBlock
Objective-C:
+  typedef void ( ^ FIRIDTokenDidChangeListenerBlock )( FIRAuth * _Nonnull , FIRUser * _Nullable )
[ADDED] FIRProviderQueryCallback
[ADDED] FIRProviderQueryCallback
Objective-C:
+  typedef void ( ^ FIRProviderQueryCallback )( NSArray < NSString *> * _Nullable , NSError * _Nullable )
[ADDED] FIRSendSignInLinkToEmailCallback
[ADDED] FIRSendSignInLinkToEmailCallback
Objective-C:
+  typedef void ( ^ FIRSendSignInLinkToEmailCallback )( NSError * _Nullable )
[ADDED] FIRAuthStateDidChangeListenerBlock
[ADDED] FIRAuthStateDidChangeListenerBlock
Objective-C:
+  typedef void ( ^ FIRAuthStateDidChangeListenerBlock )( FIRAuth * _Nonnull , FIRUser * _Nullable )
[ADDED] FIRAuthStateDidChangeListenerHandle
[ADDED] FIRAuthStateDidChangeListenerHandle
Swift:
+  typealias AuthStateDidChangeListenerHandle = NSObjectProtocol
Objective-C:
+  typedef id < NSObject > FIRAuthStateDidChangeListenerHandle
[ADDED] FIRApplyActionCodeCallback
[ADDED] FIRApplyActionCodeCallback
Objective-C:
+  typedef void ( ^ FIRApplyActionCodeCallback )( NSError * _Nullable )
[ADDED] FIRAuthResultCallback
[ADDED] FIRAuthResultCallback
Objective-C:
+  typedef void ( ^ FIRAuthResultCallback )( FIRUser * _Nullable , NSError * _Nullable )
[ADDED] FIRUserUpdateCallback
[ADDED] FIRUserUpdateCallback
Objective-C:
+  typedef void ( ^ FIRUserUpdateCallback )( NSError * _Nullable )
[ADDED] FIRVerifyPasswordResetCodeCallback
[ADDED] FIRVerifyPasswordResetCodeCallback
Objective-C:
+  typedef void ( ^ FIRVerifyPasswordResetCodeCallback )( NSString * _Nullable , NSError * _Nullable )
[ADDED] FIRAuthVoidErrorCallback
[ADDED] FIRAuthVoidErrorCallback
Objective-C:
+  typedef void ( ^ FIRAuthVoidErrorCallback )( NSError * _Nullable )
[ADDED] FIRConfirmPasswordResetCallback
[ADDED] FIRConfirmPasswordResetCallback
Objective-C:
+  typedef void ( ^ FIRConfirmPasswordResetCallback )( NSError * _Nullable )
[ADDED] FIRSignInMethodQueryCallback
[ADDED] FIRSignInMethodQueryCallback
Objective-C:
+  typedef void ( ^ FIRSignInMethodQueryCallback )( NSArray < NSString *> * _Nullable , NSError * _Nullable )
[ADDED] FIRSendPasswordResetCallback
[ADDED] FIRSendPasswordResetCallback
Objective-C:
+  typedef void ( ^ FIRSendPasswordResetCallback )( NSError * _Nullable )

@paulb777 paulb777 merged commit f964d34 into auth-swift Oct 10, 2023
29 checks passed
@paulb777 paulb777 deleted the pb-properties branch October 10, 2023 15:58
@firebase firebase locked and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants