SwiftAPI.swift 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. /*
  2. * Copyright 2022 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import Foundation
  17. import XCTest
  18. import FirebaseAuth
  19. import FirebaseCore
  20. /// This file tests public methods and enums. Properties are not included.
  21. /// Each function maps to a public header file.
  22. class AuthAPI_hOnlyTests: XCTestCase {
  23. // Each function corresponds with a public header.
  24. func FIRActionCodeSettings_h() {
  25. let codeSettings = FirebaseAuth.ActionCodeSettings()
  26. codeSettings.setIOSBundleID("abc")
  27. codeSettings.setAndroidPackageName("name", installIfNotAvailable: true, minimumVersion: "10.0")
  28. }
  29. func FIRAuth_h() throws {
  30. let auth = FirebaseAuth.Auth.auth()
  31. let authApp = FirebaseAuth.Auth.auth(app: FirebaseApp.app()!)
  32. let user = auth.currentUser!
  33. auth.updateCurrentUser(user) { _ in
  34. }
  35. authApp.fetchSignInMethods(forEmail: "abc@abc.com") { string, error in
  36. }
  37. auth.signIn(withEmail: "abc@abc.com", password: "password") { result, error in
  38. }
  39. auth.signIn(withEmail: "abc@abc.com", link: "link") { result, error in
  40. }
  41. let provider = OAuthProvider(providerID: "abc")
  42. auth.signIn(with: OAuthProvider(providerID: "abc"), uiDelegate: nil) { result, error in
  43. }
  44. provider.getCredentialWith(nil) { credential, error in
  45. auth.signIn(with: credential!) { result, error in
  46. }
  47. }
  48. auth.signIn(with: OAuthProvider(providerID: "abc"), uiDelegate: nil) { result, error in
  49. }
  50. auth.signInAnonymously { result, error in
  51. }
  52. auth.signIn(withCustomToken: "abc") { result, error in
  53. }
  54. auth.createUser(withEmail: "email", password: "password") { result, error in
  55. }
  56. auth.confirmPasswordReset(withCode: "code", newPassword: "password") { error in
  57. }
  58. auth.checkActionCode("abc") { codeInfo, error in
  59. }
  60. auth.verifyPasswordResetCode("code") { email, error in
  61. }
  62. auth.applyActionCode("code") { error in
  63. }
  64. auth.sendPasswordReset(withEmail: "email") { error in
  65. }
  66. let actionCodeSettings = ActionCodeSettings()
  67. auth.sendPasswordReset(withEmail: "email", actionCodeSettings: actionCodeSettings) { error in
  68. }
  69. auth.sendSignInLink(toEmail: "email", actionCodeSettings: actionCodeSettings) { error in
  70. }
  71. try auth.signOut()
  72. auth.isSignIn(withEmailLink: "link")
  73. let handle = auth.addStateDidChangeListener { auth, user in
  74. }
  75. auth.removeStateDidChangeListener(handle)
  76. auth.addIDTokenDidChangeListener { auth, user in
  77. }
  78. auth.removeIDTokenDidChangeListener(handle)
  79. auth.useAppLanguage()
  80. auth.useEmulator(withHost: "myHost", port: 123)
  81. auth.canHandle(URL(fileURLWithPath: "/my/path"))
  82. auth.setAPNSToken(Data(), type: AuthAPNSTokenType(rawValue: 2)!)
  83. auth.canHandleNotification([:])
  84. try auth.useUserAccessGroup("abc")
  85. let nilUser = try auth.getStoredUser(forAccessGroup: "def")
  86. // If nilUser is not optional, this will raise a compiler error.
  87. // This condition does not need to execute, and may not if prior
  88. // functions throw.
  89. if let value = nilUser {
  90. XCTAssert(true)
  91. }
  92. }
  93. #if compiler(>=5.5.2) && canImport(_Concurrency)
  94. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  95. func FIRAuth_hAsync() async throws {
  96. let auth = FirebaseAuth.Auth.auth()
  97. let user = auth.currentUser!
  98. try await auth.updateCurrentUser(user)
  99. _ = try await auth.fetchSignInMethods(forEmail: "abc@abc.com")
  100. _ = try await auth.signIn(withEmail: "abc@abc.com", password: "password")
  101. _ = try await auth.signIn(withEmail: "abc@abc.com", link: "link")
  102. let provider = OAuthProvider(providerID: "abc")
  103. let credential = try await provider.credential(with: nil)
  104. _ = try await auth.signIn(with: OAuthProvider(providerID: "abc"), uiDelegate: nil)
  105. _ = try await auth.signIn(with: credential)
  106. _ = try await auth.signInAnonymously()
  107. _ = try await auth.signIn(withCustomToken: "abc")
  108. _ = try await auth.createUser(withEmail: "email", password: "password")
  109. _ = try await auth.confirmPasswordReset(withCode: "code", newPassword: "password")
  110. _ = try await auth.checkActionCode("abc")
  111. _ = try await auth.verifyPasswordResetCode("code")
  112. _ = try await auth.applyActionCode("code")
  113. _ = try await auth.sendPasswordReset(withEmail: "email")
  114. let actionCodeSettings = ActionCodeSettings()
  115. _ = try await auth.sendPasswordReset(
  116. withEmail: "email",
  117. actionCodeSettings: actionCodeSettings
  118. )
  119. _ = try await auth.sendSignInLink(toEmail: "email", actionCodeSettings: actionCodeSettings)
  120. }
  121. #endif
  122. func FIRAuthAPNSTokenType_h() {
  123. _ = AuthAPNSTokenType.unknown
  124. _ = AuthAPNSTokenType.sandbox
  125. _ = AuthAPNSTokenType.prod
  126. }
  127. func FIRAuthErrors_h() {
  128. _ = AuthErrorCode.invalidCustomToken
  129. _ = AuthErrorCode.customTokenMismatch
  130. _ = AuthErrorCode.invalidCredential
  131. _ = AuthErrorCode.userDisabled
  132. _ = AuthErrorCode.operationNotAllowed
  133. _ = AuthErrorCode.emailAlreadyInUse
  134. _ = AuthErrorCode.invalidEmail
  135. _ = AuthErrorCode.wrongPassword
  136. _ = AuthErrorCode.tooManyRequests
  137. _ = AuthErrorCode.userNotFound
  138. _ = AuthErrorCode.accountExistsWithDifferentCredential
  139. _ = AuthErrorCode.requiresRecentLogin
  140. _ = AuthErrorCode.providerAlreadyLinked
  141. _ = AuthErrorCode.noSuchProvider
  142. _ = AuthErrorCode.invalidUserToken
  143. _ = AuthErrorCode.networkError
  144. _ = AuthErrorCode.userTokenExpired
  145. _ = AuthErrorCode.invalidAPIKey
  146. _ = AuthErrorCode.userMismatch
  147. _ = AuthErrorCode.credentialAlreadyInUse
  148. _ = AuthErrorCode.weakPassword
  149. _ = AuthErrorCode.appNotAuthorized
  150. _ = AuthErrorCode.expiredActionCode
  151. _ = AuthErrorCode.invalidActionCode
  152. _ = AuthErrorCode.invalidMessagePayload
  153. _ = AuthErrorCode.invalidSender
  154. _ = AuthErrorCode.invalidRecipientEmail
  155. _ = AuthErrorCode.missingEmail
  156. _ = AuthErrorCode.missingIosBundleID
  157. _ = AuthErrorCode.missingAndroidPackageName
  158. _ = AuthErrorCode.unauthorizedDomain
  159. _ = AuthErrorCode.invalidContinueURI
  160. _ = AuthErrorCode.missingContinueURI
  161. _ = AuthErrorCode.missingPhoneNumber
  162. _ = AuthErrorCode.invalidPhoneNumber
  163. _ = AuthErrorCode.missingVerificationCode
  164. _ = AuthErrorCode.invalidVerificationCode
  165. _ = AuthErrorCode.missingVerificationID
  166. _ = AuthErrorCode.invalidVerificationID
  167. _ = AuthErrorCode.missingAppCredential
  168. _ = AuthErrorCode.invalidAppCredential
  169. _ = AuthErrorCode.sessionExpired
  170. _ = AuthErrorCode.quotaExceeded
  171. _ = AuthErrorCode.missingAppToken
  172. _ = AuthErrorCode.notificationNotForwarded
  173. _ = AuthErrorCode.appNotVerified
  174. _ = AuthErrorCode.captchaCheckFailed
  175. _ = AuthErrorCode.webContextAlreadyPresented
  176. _ = AuthErrorCode.webContextCancelled
  177. _ = AuthErrorCode.appVerificationUserInteractionFailure
  178. _ = AuthErrorCode.invalidClientID
  179. _ = AuthErrorCode.webNetworkRequestFailed
  180. _ = AuthErrorCode.webInternalError
  181. _ = AuthErrorCode.webSignInUserInteractionFailure
  182. _ = AuthErrorCode.localPlayerNotAuthenticated
  183. _ = AuthErrorCode.nullUser
  184. _ = AuthErrorCode.dynamicLinkNotActivated
  185. _ = AuthErrorCode.invalidProviderID
  186. _ = AuthErrorCode.tenantIDMismatch
  187. _ = AuthErrorCode.unsupportedTenantOperation
  188. _ = AuthErrorCode.invalidDynamicLinkDomain
  189. _ = AuthErrorCode.rejectedCredential
  190. _ = AuthErrorCode.gameKitNotLinked
  191. _ = AuthErrorCode.secondFactorRequired
  192. _ = AuthErrorCode.missingMultiFactorSession
  193. _ = AuthErrorCode.missingMultiFactorInfo
  194. _ = AuthErrorCode.invalidMultiFactorSession
  195. _ = AuthErrorCode.multiFactorInfoNotFound
  196. _ = AuthErrorCode.adminRestrictedOperation
  197. _ = AuthErrorCode.unverifiedEmail
  198. _ = AuthErrorCode.secondFactorAlreadyEnrolled
  199. _ = AuthErrorCode.maximumSecondFactorCountExceeded
  200. _ = AuthErrorCode.unsupportedFirstFactor
  201. _ = AuthErrorCode.emailChangeNeedsVerification
  202. _ = AuthErrorCode.missingOrInvalidNonce
  203. _ = AuthErrorCode.recaptchaNotEnabled
  204. _ = AuthErrorCode.missingRecaptchaToken
  205. _ = AuthErrorCode.invalidRecaptchaToken
  206. _ = AuthErrorCode.invalidRecaptchaAction
  207. _ = AuthErrorCode.missingClientType
  208. _ = AuthErrorCode.missingRecaptchaVersion
  209. _ = AuthErrorCode.invalidRecaptchaVersion
  210. _ = AuthErrorCode.invalidReqType
  211. _ = AuthErrorCode.keychainError
  212. _ = AuthErrorCode.internalError
  213. _ = AuthErrorCode.malformedJWT
  214. }
  215. func FIRAuthUIDelegate_h() {
  216. class AuthUIImpl: NSObject, AuthUIDelegate {
  217. func present(_ viewControllerToPresent: UIViewController, animated flag: Bool,
  218. completion: (() -> Void)? = nil) {}
  219. func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) {}
  220. }
  221. let obj = AuthUIImpl()
  222. obj.present(UIViewController(), animated: true) {}
  223. obj.dismiss(animated: false) {}
  224. }
  225. #if compiler(>=5.5.2) && canImport(_Concurrency)
  226. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  227. func FIRAuthUIDelegate_hAsync() async {
  228. class AuthUIImpl: NSObject, AuthUIDelegate {
  229. func present(_ viewControllerToPresent: UIViewController, animated flag: Bool) async {}
  230. func dismiss(animated flag: Bool) async {}
  231. }
  232. let obj = AuthUIImpl()
  233. await obj.present(UIViewController(), animated: true)
  234. await obj.dismiss(animated: false)
  235. }
  236. #endif
  237. func FIREmailAuthProvider_h() {
  238. _ = EmailAuthProvider.credential(withEmail: "e@email.com", password: "password")
  239. _ = EmailAuthProvider.credential(withEmail: "e@email.com", link: "link")
  240. }
  241. func FIRFacebookAuthProvider_h() {
  242. _ = FacebookAuthProvider.credential(withAccessToken: "token")
  243. }
  244. func FIRFdederatedAuthProvider_h() {
  245. class FederatedAuthImplementation: NSObject, FederatedAuthProvider {
  246. func getCredentialWith(_ UIDelegate: AuthUIDelegate?,
  247. completion: ((AuthCredential?, Error?) -> Void)? = nil) {}
  248. }
  249. let obj = FederatedAuthImplementation()
  250. obj.getCredentialWith(nil) { _, _ in
  251. }
  252. }
  253. #if compiler(>=5.5.2) && canImport(_Concurrency)
  254. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  255. func FIRFedederatedAuthProvider_hAsync() async throws {
  256. class FederatedAuthImplementation: NSObject, FederatedAuthProvider {
  257. func credential(with UIDelegate: AuthUIDelegate?) async throws -> AuthCredential {
  258. return FacebookAuthProvider.credential(withAccessToken: "token")
  259. }
  260. }
  261. let obj = FederatedAuthImplementation()
  262. try await _ = obj.credential(with: nil)
  263. }
  264. #endif
  265. func FIRGameCenterAuthProvider_h() {
  266. GameCenterAuthProvider.getCredential { _, _ in
  267. }
  268. }
  269. #if compiler(>=5.5.2) && canImport(_Concurrency)
  270. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  271. func FIRGameCenterAuthProvider_hAsync() async throws {
  272. _ = try await GameCenterAuthProvider.getCredential()
  273. }
  274. #endif
  275. func FIRGitHubAuthProvider_h() {
  276. _ = GitHubAuthProvider.credential(withToken: "token")
  277. }
  278. func FIRGoogleAuthProvider_h() {
  279. _ = GoogleAuthProvider.credential(withIDToken: "token", accessToken: "aToken")
  280. }
  281. func FIRMultiFactor_h() {
  282. let obj = MultiFactor()
  283. obj.getSessionWithCompletion { _, _ in
  284. }
  285. obj.enroll(with: MultiFactorAssertion(), displayName: "name") { _ in
  286. }
  287. obj.unenroll(with: MultiFactorInfo()) { _ in
  288. }
  289. obj.unenroll(withFactorUID: "uid") { _ in
  290. }
  291. }
  292. #if compiler(>=5.5.2) && canImport(_Concurrency)
  293. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  294. func FIRMultiFactor_hAsync() async throws {
  295. let obj = MultiFactor()
  296. try await obj.session()
  297. try await obj.enroll(with: MultiFactorAssertion(), displayName: "name")
  298. try await obj.unenroll(with: MultiFactorInfo())
  299. try await obj.unenroll(withFactorUID: "uid")
  300. }
  301. #endif
  302. func FIRMultiFactorResolver_h() {
  303. let obj = MultiFactorResolver()
  304. obj.resolveSignIn(with: MultiFactorAssertion()) { _, _ in
  305. }
  306. }
  307. #if compiler(>=5.5.2) && canImport(_Concurrency)
  308. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  309. func FIRMultiFactorResolver_hAsync() async throws {
  310. let obj = MultiFactorResolver()
  311. try await obj.resolveSignIn(with: MultiFactorAssertion())
  312. }
  313. #endif
  314. func FIROAuthProvider_h() {
  315. let provider = OAuthProvider(providerID: "id", auth: FirebaseAuth.Auth.auth())
  316. _ = provider.providerID
  317. _ = OAuthProvider.credential(withProviderID: "id", idToken: "idToden", accessToken: "token")
  318. _ = OAuthProvider.credential(withProviderID: "id", accessToken: "token")
  319. _ = OAuthProvider.credential(withProviderID: "id", idToken: "idToken", rawNonce: "nonce",
  320. accessToken: "token")
  321. _ = OAuthProvider.credential(withProviderID: "id", idToken: "idToken", rawNonce: "nonce")
  322. }
  323. func FIRPhoneAuthProvider_h() {
  324. _ = PhoneAuthProvider.provider()
  325. let provider = PhoneAuthProvider.provider(auth: FirebaseAuth.Auth.auth())
  326. provider.verifyPhoneNumber("123", uiDelegate: nil) { _, _ in
  327. }
  328. provider.verifyPhoneNumber("123", uiDelegate: nil, multiFactorSession: nil) { _, _ in
  329. }
  330. provider.verifyPhoneNumber(
  331. with: PhoneMultiFactorInfo(),
  332. uiDelegate: nil,
  333. multiFactorSession: nil
  334. ) { _, _ in
  335. }
  336. provider.verifyPhoneNumber("123", uiDelegate: nil, multiFactorSession: nil) { _, _ in
  337. }
  338. provider.credential(withVerificationID: "id", verificationCode: "code")
  339. }
  340. #if compiler(>=5.5.2) && canImport(_Concurrency)
  341. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  342. func FIRPhoneAuthProvider_hAsync() async throws {
  343. _ = PhoneAuthProvider.provider()
  344. let provider = PhoneAuthProvider.provider(auth: FirebaseAuth.Auth.auth())
  345. try await provider.verifyPhoneNumber("123", uiDelegate: nil)
  346. try await provider.verifyPhoneNumber("123", uiDelegate: nil, multiFactorSession: nil)
  347. try await provider.verifyPhoneNumber(with: PhoneMultiFactorInfo(), uiDelegate: nil,
  348. multiFactorSession: nil)
  349. try await provider.verifyPhoneNumber("123", uiDelegate: nil, multiFactorSession: nil)
  350. }
  351. #endif
  352. func FIRPhoneMultiFactorGenerator_h() {
  353. let credential = PhoneAuthProvider.provider().credential(withVerificationID: "id",
  354. verificationCode: "code")
  355. PhoneMultiFactorGenerator.assertion(with: credential)
  356. }
  357. func FIRTOTPSecret_h() {
  358. let obj = TOTPSecret()
  359. obj.sharedSecretKey()
  360. obj.generateQRCodeURL(withAccountName: "name", issuer: "issuer")
  361. obj.openInOTPApp(withQRCodeURL: "url")
  362. }
  363. func FIRTOTPMultiFactorGenerator_h() {
  364. TOTPMultiFactorGenerator.generateSecret(with: MultiFactorSession()) { _, _ in
  365. }
  366. TOTPMultiFactorGenerator.assertionForEnrollment(with: TOTPSecret(), oneTimePassword: "code")
  367. TOTPMultiFactorGenerator.assertionForSignIn(withEnrollmentID: "id",
  368. oneTimePassword: "code")
  369. }
  370. #if compiler(>=5.5.2) && canImport(_Concurrency)
  371. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  372. func FIRTOTPMultiFactorGenerator_hAsync() async throws {
  373. try await TOTPMultiFactorGenerator.generateSecret(with: MultiFactorSession())
  374. }
  375. #endif
  376. func FIRTwitterAuthProvider_h() {
  377. _ = TwitterAuthProvider.credential(withToken: "token", secret: "secret")
  378. }
  379. func FIRUser_h() {
  380. let auth = FirebaseAuth.Auth.auth()
  381. let user = auth.currentUser!
  382. let credential = PhoneAuthProvider.provider().credential(withVerificationID: "id",
  383. verificationCode: "code")
  384. let provider = PhoneAuthProvider.provider(auth: FirebaseAuth.Auth.auth())
  385. user.updateEmail(to: "email") { _ in
  386. }
  387. user.updatePassword(to: "password") { _ in
  388. }
  389. user.updatePhoneNumber(credential) { _ in
  390. }
  391. let changeRequest = user.createProfileChangeRequest()
  392. user.reload { _ in
  393. }
  394. user.reauthenticate(with: credential) { _, _ in
  395. }
  396. user.reauthenticate(with: provider as! FederatedAuthProvider, uiDelegate: nil)
  397. user.getIDTokenResult { _, _ in
  398. }
  399. user.getIDTokenResult(forcingRefresh: true) { _, _ in
  400. }
  401. user.getIDTokenResult { _, _ in
  402. }
  403. user.getIDTokenForcingRefresh(true) { _, _ in
  404. }
  405. user.link(with: credential) { _, _ in
  406. }
  407. user.link(with: provider as! FederatedAuthProvider, uiDelegate: nil) { _, _ in
  408. }
  409. user.unlink(fromProvider: "abc") { _, _ in
  410. }
  411. user.sendEmailVerification { _ in
  412. }
  413. user.sendEmailVerification(with: ActionCodeSettings()) { _ in
  414. }
  415. user.delete { _ in
  416. }
  417. user.sendEmailVerification(beforeUpdatingEmail: "email") { _ in
  418. }
  419. user.sendEmailVerification(
  420. beforeUpdatingEmail: "email",
  421. actionCodeSettings: ActionCodeSettings()
  422. ) { _ in
  423. }
  424. changeRequest.commitChanges { _ in
  425. }
  426. }
  427. #if compiler(>=5.5.2) && canImport(_Concurrency)
  428. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  429. func FIRUser_hAsync() async throws {
  430. let auth = FirebaseAuth.Auth.auth()
  431. let user = auth.currentUser!
  432. let credential = PhoneAuthProvider.provider().credential(withVerificationID: "id",
  433. verificationCode: "code")
  434. let provider = PhoneAuthProvider.provider(auth: FirebaseAuth.Auth.auth())
  435. try await user.updateEmail(to: "email")
  436. try await user.updatePassword(to: "password")
  437. try await user.updatePhoneNumber(credential)
  438. let changeRequest = user.createProfileChangeRequest()
  439. try await user.reload()
  440. try await user.reauthenticate(with: credential)
  441. try await user.reauthenticate(with: provider as! FederatedAuthProvider, uiDelegate: nil)
  442. try await user.getIDTokenResult()
  443. try await user.getIDTokenResult(forcingRefresh: true)
  444. try await user.getIDTokenResult()
  445. try await user.link(with: credential)
  446. try await user.link(with: provider as! FederatedAuthProvider, uiDelegate: nil)
  447. try await user.unlink(fromProvider: "abc")
  448. try await user.sendEmailVerification()
  449. try await user.sendEmailVerification(with: ActionCodeSettings())
  450. try await user.delete()
  451. try await user.sendEmailVerification(beforeUpdatingEmail: "email")
  452. try await user.sendEmailVerification(
  453. beforeUpdatingEmail: "email",
  454. actionCodeSettings: ActionCodeSettings()
  455. )
  456. try await changeRequest.commitChanges()
  457. }
  458. #endif
  459. }