Skip to content

Conversation

@zhouxl
Copy link
Collaborator

@zhouxl zhouxl commented Dec 5, 2025

Related Issue

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

Simulator.Screen.Recording.-.Tmp.-.2025-12-23.at.10.38.39.mov

@zhouxl zhouxl linked an issue Dec 5, 2025 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

PR Summary

Implemented a native bridge for the onboarding workflow in iOS, enabling React Native to launch native screens and perform onboarding operations. Added new TurboModule methods for seed phrase generation, account registration, wallet initialization, notification permissions, and profile management. Introduced dynamic root view switching between React Native and native SideContainerView based on profile state. Updated account types, added new error cases, and integrated restore functionality through native screen routing.

Changes

File Summary
FRW.xcodeproj/project.pbxproj Added NativeScreenName.swift and TurboModule+Onboard.swift to the project build phases for both targets.
FRW/Foundation/Bridge/BridgeModels.swift Changed AccountTypeType enum cases from eoa/coa to full/hardware for clearer semantics.
FRW/Foundation/Bridge/NativeScreenName.swift New file. Defines NativeScreenName enum with cases for various restore and backup screens like deviceBackup, recoveryPhraseRestore, googleDriveRestore, icloudRestore, etc.
FRW/Foundation/Bridge/RCTNativeFRWBridge.mm Added bridge methods: getCurrentUserUid, launchNativeScreen, getDeviceId, notification permission methods, generateSeedPhrase, registerSecureTypeAccount, initSecureEnclaveWallet, signInWithCustomToken, saveMnemonic, getRecoverableProfiles, switchToProfile, and shareQRCode.
FRW/Foundation/Bridge/RNBridgeError.swift Added error cases: mnemonicGenerationFailed, mnemonicSaveFailed, keyGenerationFailed, invalidMnemonic, accountCreationFailed, and walletInitializationFailed.
FRW/Foundation/Bridge/TurboModule+Onboard.swift New file. Implements onboarding methods: generateSeedPhrase, registerSecureTypeAccount, initSecureEnclaveWallet, signInWithCustomToken, saveMnemonic, setScreenSecurityLevel, requestNotificationPermission, checkNotificationPermission, and getDeviceId.
FRW/Foundation/Bridge/TurboModuleSwift.swift Added getCurrentUserUid, getRecoverableProfiles, switchToProfile, shareQRCode, and launchNativeScreen methods. The launchNativeScreen routes to various restore/backup screens based on NativeScreenName.
FRW/Modules/Browser/View/Auth/AuthnViewModel.swift Added isShowCoa flag based on isHidden property of COA account to determine whether to show COA accounts in the authentication view.
FRW/Modules/MultiBackup/View/BackupListView.swift Changed Router.pop() to Router.popToRoot() when dismissing the backup list view.
FRW/Modules/MultiBackup/ViewModel/BackupListViewModel.swift Replaced DispatchQueue.main.async with await MainActor.run for setting isLoading state.
FRW/Modules/Profile/ProfileView.swift Updated backup row style to show progress indicator during fetching. Added guard to prevent navigation while fetching. Added Divider before developer section.
FRW/Modules/Profile/ProfileViewModel.swift Simplified BackupFetchingState enum. Changed refreshBackupState to use BackupListViewModel for fetching multi-backup status. Added receive(on: DispatchQueue.main) for theme updates.
FRW/Modules/ReactNative/ReactNativeViewController.swift Added profileSelection and getStarted routes. Added route property for direct route assignment. Changed topAnchor constraint from safe area to view top. Hides navigation bar in viewWillAppear.
FRW/Modules/TransactionList/TransferListHandler.swift Added isEOA check alongside isCOA to use EVM transfers API for both EOA and COA accounts.
FRW/Modules/Wallet/AccountSwitch/AccountSwitchViewModel.swift Changed createNewAccountAction to route to RouteMap.ReactNative.profileSelection instead of native registration.
FRW/Modules/Wallet/TokenDetail/TokenDetailView.swift Replaced navigationBarItems with toolbar and ToolbarItem for the delete token menu, with conditional visibility.
FRW/Modules/Wallet/WalletAccount/WalletAccount+FlowWalletKit.swift Added parentInfo construction from parentAddress parameter when creating EOA WalletAccount.
FRW/Resource/en.lproj/Localizable.strings Added "delete_nft" localization key with value "Delete NFT".
FRW/Services/Manager/Transaction/TransactionHolder.swift Added .receive(on: DispatchQueue.main) to transaction status subscription sink.
FRW/Services/Manager/UserManager.swift Added RNRegisterInfo dictionary to track transaction IDs to user IDs during registration. Updated register to store mapping and return transaction ID from wallet creation.
FRW/Services/Manager/Wallet/WalletManager.swift Changed asyncCreateWalletAddressFromServer from Void to async -> String?, returning the transaction ID on success.
FRW/Services/Router/Coordinator.swift Added updateRootView method to switch between React Native (getStarted) and SideContainerView based on profile state. Subscribes to ProfileManager.shared.$profiles for dynamic updates with animation.
FRW/Services/Router/RouteMap+React.swift Added profileSelection and getStarted cases to RouteMap.ReactNative with corresponding navigation logic.
Podfile.lock Updated Instabug to 16.0.3, RNInstabug to 16.0.3, RNReanimated to 3.19.2. Added react-native-view-shot and RNShare pods.
main.jsbundle Updated compiled JavaScript bundle with new React Native code.

autogenerated by presubmit.ai

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (2)
  • 00e8933: feat: launchNativeScreen
  • d7800bc: feat: create bridge launchNativeScreen
Files Processed (4)
  • FRW.xcodeproj/project.pbxproj (13 hunks)
  • FRW/Foundation/Bridge/NativeScreenName.swift (1 hunk)
  • FRW/Foundation/Bridge/RCTNativeFRWBridge.mm (1 hunk)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift (1 hunk)
Actionable Comments (1)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [385-385]

    possible bug: "Possible typo in method name."

Skipped Comments (2)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [368-370]

    readability: "Variable shadowing may cause confusion in error logging."

  • FRW/Foundation/Bridge/TurboModuleSwift.swift [376-376]

    performance: "Unnecessary object instantiation for some code paths."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (1)
  • 411f0d3: Merge branch 'dev' into 310/972-ios-create-native-bridge-for-onboarding-workflow
Files Processed (3)
  • FRW.xcodeproj/project.pbxproj (13 hunks)
  • FRW/Foundation/Bridge/NativeScreenName.swift (1 hunk)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [369-369]

    readability: "Misleading variable shadowing in error log message."

  • FRW/Foundation/Bridge/TurboModuleSwift.swift [376-376]

    performance: "Unnecessary object instantiation for some screen types."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (1)
Files Processed (15)
  • FRW.xcodeproj/project.pbxproj (9 hunks)
  • FRW/Foundation/Bridge/BridgeModels.swift (1 hunk)
  • FRW/Foundation/Bridge/NativeScreenName.swift (1 hunk)
  • FRW/Foundation/Bridge/RCTNativeFRWBridge.mm (1 hunk)
  • FRW/Foundation/Bridge/RNBridgeError.swift (1 hunk)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift (1 hunk)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift (2 hunks)
  • FRW/Modules/MultiBackup/View/BackupListView.swift (2 hunks)
  • FRW/Modules/ReactNative/ReactNativeViewController.swift (3 hunks)
  • FRW/Modules/Wallet/AccountSwitch/AccountSwitchViewModel.swift (1 hunk)
  • FRW/Modules/Wallet/SideMenu/SideContainerView.swift (1 hunk)
  • FRW/Services/Manager/UserManager.swift (3 hunks)
  • FRW/Services/Manager/Wallet/WalletManager.swift (1 hunk)
  • FRW/Services/Router/RouteMap+React.swift (2 hunks)
  • main.jsbundle (0 hunks)
Actionable Comments (1)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [107-110]

    possible issue: "Unused parameters in saveMnemonic method."

Skipped Comments (7)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [52-52]

    best practice: "Debug print statements should be removed or use proper logging."

  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [107-107]

    security: "Debug print statement in sensitive mnemonic handling method."

  • FRW/Foundation/Bridge/TurboModuleSwift.swift [370-372]

    readability: "Variable shadowing causes confusing error message."

  • FRW/Services/Manager/UserManager.swift [82-82]

    possible issue: "Dictionary may grow indefinitely without cleanup."

  • FRW/Modules/Wallet/AccountSwitch/AccountSwitchViewModel.swift [37-39]

    maintainability: "Commented-out code should be removed."

  • FRW/Modules/Wallet/SideMenu/SideContainerView.swift [40-44]

    maintainability: "Empty HStack used as a workaround for onAppear."

  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [21-24]

    best practice: "UI feedback mixed with error throwing logic."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (2)
  • 14913e4: feat: update React Native topAnchor
  • 74f733c: feat: push onboarding
Files Processed (2)
  • FRW/Modules/ReactNative/ReactNativeViewController.swift (4 hunks)
  • FRW/Services/Router/RouteMap+React.swift (2 hunks)
Actionable Comments (0)
Skipped Comments (2)
  • FRW/Modules/ReactNative/ReactNativeViewController.swift [178-178]

    possible issue: "Default route fallback may be inappropriate for new onboarding routes."

  • FRW/Services/Router/RouteMap+React.swift [29-32]

    maintainability: "Inconsistent initialization pattern between route cases."

@zhouxl zhouxl marked this pull request as ready for review December 16, 2025 09:52
@zhouxl zhouxl requested a review from a team as a code owner December 16, 2025 09:52
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (1)
  • ee5a37b: Merge branch 'dev' into 310/972-ios-create-native-bridge-for-onboarding-workflow
Files Processed (3)
  • FRW.xcodeproj/project.pbxproj (9 hunks)
  • FRW/Services/Manager/UserManager.swift (3 hunks)
  • FRW/Services/Manager/Wallet/WalletManager.swift (1 hunk)
Actionable Comments (1)
  • FRW/Services/Manager/UserManager.swift [83-83]

    possible bug: "Dictionary may have thread-safety issues when accessed from multiple threads."

Skipped Comments (3)
  • FRW/Services/Manager/UserManager.swift [83-83]

    best practice: "Variable name does not follow Swift naming conventions."

  • FRW/Services/Manager/UserManager.swift [218-218]

    possible issue: "No error handling when wallet address creation fails."

  • FRW/Services/Manager/UserManager.swift [227-229]

    maintainability: "Dictionary entries are never cleaned up, potentially causing memory growth."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (1)
Files Processed (3)
  • FRW/Modules/Profile/ProfileViewModel.swift (1 hunk)
  • FRW/Services/Manager/Transaction/TransactionHolder.swift (1 hunk)
  • main.jsbundle (0 hunks)
Actionable Comments (0)
Skipped Comments (1)
  • FRW/Services/Manager/Transaction/TransactionHolder.swift [95-98]

    possible issue: "Verify that completion handler should also run on main queue."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (1)
  • 169fbc1: feat: eoa add parent for RN
Files Processed (1)
  • FRW/Modules/Wallet/WalletAccount/WalletAccount+FlowWalletKit.swift (1 hunk)
Actionable Comments (0)
Skipped Comments (1)
  • FRW/Modules/Wallet/WalletAccount/WalletAccount+FlowWalletKit.swift [133-139]

    possible issue: "Empty string handling for optional parent address."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (2)
  • 9e18ef4: feat: switch root between RN and SideContainerView
  • 12e0d10: feat: start with onboard for no profile
Files Processed (5)
  • FRW/Foundation/Bridge/RCTNativeFRWBridge.mm (2 hunks)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift (1 hunk)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift (4 hunks)
  • FRW/Modules/ReactNative/ReactNativeViewController.swift (5 hunks)
  • FRW/Services/Router/Coordinator.swift (1 hunk)
Actionable Comments (0)
Skipped Comments (5)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [251-253]

    possible issue: "Empty method implementation will silently do nothing."

  • FRW/Foundation/Bridge/TurboModuleSwift.swift [392-394]

    possible bug: "Variable shadowing causes incorrect error message."

  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [111-119]

    possible issue: "Screen security method has no actual implementation."

  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [137-137]

    best practice: "Debug print statement should use proper logging."

  • FRW/Services/Router/Coordinator.swift [101-101]

    enhancement: "Animation parameter may cause visual issues during initial setup."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (1)
  • 98f43e4: feat: add animation and setup flag
Files Processed (1)
  • FRW/Services/Router/Coordinator.swift (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
  • FRW/Services/Router/Coordinator.swift [77-83]

    possible issue: "Subscription may not be properly cleaned up on coordinator reuse."

  • FRW/Services/Router/Coordinator.swift [127-131]

    enhancement: "Animation approach may cause visual artifacts during root view transition."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (1)
  • c5dd810: feat: add restore from icloud
Files Processed (2)
  • FRW/Foundation/Bridge/NativeScreenName.swift (1 hunk)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift (4 hunks)
Actionable Comments (1)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [392-394]

    possible bug: "Variable shadowing causes incorrect error message."

Skipped Comments (3)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [251-253]

    possible issue: "Empty method implementation may cause silent failures."

  • FRW/Foundation/Bridge/TurboModuleSwift.swift [240-243]

    possible issue: "Method returns all profiles instead of filtering for recoverable ones."

  • FRW/Foundation/Bridge/TurboModuleSwift.swift [7-8]

    maintainability: "Unused import statement."

Comment on lines +392 to +394
guard let screen = NativeScreenName(rawValue: screen) else {
log.error("don't support route \(screen)")
HUD.error(title: "don't support route \(screen)")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message logs and displays the screen variable after it has been shadowed by the failed NativeScreenName initialization, which will always be nil at that point. The original screen: String parameter should be used in the error message instead.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (1)
  • cf61a89: feat: Are there multiple backups
Files Processed (2)
  • FRW/Modules/Profile/ProfileView.swift (4 hunks)
  • FRW/Modules/Profile/ProfileViewModel.swift (3 hunks)
Actionable Comments (1)
  • FRW/Modules/Profile/ProfileViewModel.swift [57-57]

    possible bug: "Potential retain cycle due to strong self reference in closure."

Skipped Comments (2)
  • FRW/Modules/Profile/ProfileView.swift [299-301]

    enhancement: "Missing user feedback when button action is blocked."

  • FRW/Modules/Profile/ProfileView.swift [306-306]

    possible issue: "Condition may not handle all backup states as expected."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (1)
  • 5e87bd0: feat: show coa first when it has asset
Files Processed (1)
  • FRW/Modules/Browser/View/Auth/AuthnViewModel.swift (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
  • FRW/Modules/Browser/View/Auth/AuthnViewModel.swift [62-64]

    possible issue: "Logic only considers the first COA account's hidden state."

  • FRW/Modules/Browser/View/Auth/AuthnViewModel.swift [65-65]

    possible bug: "Default value of isShowCoa may change behavior when COA accounts are empty."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (2)
  • c62cffb: feat: remove backupTypeDidChanged on profile
  • ea50427: feat: fetch error on transfer list
Files Processed (3)
  • FRW/Modules/MultiBackup/ViewModel/BackupListViewModel.swift (1 hunk)
  • FRW/Modules/Profile/ProfileViewModel.swift (3 hunks)
  • FRW/Modules/TransactionList/TransferListHandler.swift (1 hunk)
Actionable Comments (0)
Skipped Comments (3)
  • FRW/Modules/Profile/ProfileViewModel.swift [89-96]

    readability: "Guard statements check for nil but discard the unwrapped values."

  • FRW/Modules/Profile/ProfileViewModel.swift [98-102]

    performance: "Creating a new view model instance on each refresh may be inefficient."

  • FRW/Modules/Profile/ProfileViewModel.swift [41-45]

    enhancement: "Theme manager subscription now explicitly receives on main queue."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (2)
Files Processed (2)
  • FRW/Modules/Profile/ProfileView.swift (5 hunks)
  • Podfile.lock (15 hunks)
Actionable Comments (0)
Skipped Comments (1)
  • FRW/Modules/Profile/ProfileView.swift [306-306]

    possible bug: "Potential confusion between enum case .none and Optional.none."

@zhouxl zhouxl requested a review from lmcmz December 23, 2025 02:42
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (1)
  • 7aee0f0: feat: bar item on iOS 26
Files Processed (1)
  • FRW/Modules/Wallet/TokenDetail/TokenDetailView.swift (1 hunk)
Actionable Comments (1)
  • FRW/Modules/Wallet/TokenDetail/TokenDetailView.swift [89-89]

    typo: "Possible typo in button label."

Skipped Comments (0)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (1)
Files Processed (2)
  • FRW/Modules/Wallet/TokenDetail/TokenDetailView.swift (1 hunk)
  • FRW/Resource/en.lproj/Localizable.strings (1 hunk)
Actionable Comments (0)
Skipped Comments (1)
  • FRW/Resource/en.lproj/Localizable.strings [1205-1205]

    possible issue: "Localization key/value mismatch between token and NFT terminology."

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (22)
  • 378403d: Merge branch 'dev' into 310/972-ios-create-native-bridge-for-onboarding-workflow
  • 95493ad: feat: local
  • 7aee0f0: feat: bar item on iOS 26
  • f063db8: feat: update lock
  • e8d54ed: feat: add line
  • c62cffb: feat: remove backupTypeDidChanged on profile
  • ea50427: feat: fetch error on transfer list
  • 5e87bd0: feat: show coa first when it has asset
  • cf61a89: feat: Are there multiple backups
  • c5dd810: feat: add restore from icloud
  • 98f43e4: feat: add animation and setup flag
  • 9e18ef4: feat: switch root between RN and SideContainerView
  • 12e0d10: feat: start with onboard for no profile
  • 169fbc1: feat: eoa add parent for RN
  • a3d7777: feat: update RN
  • ee5a37b: Merge branch 'dev' into 310/972-ios-create-native-bridge-for-onboarding-workflow
  • 14913e4: feat: update React Native topAnchor
  • 74f733c: feat: push onboarding
  • d28c43b: feat: onboarding
  • 411f0d3: Merge branch 'dev' into 310/972-ios-create-native-bridge-for-onboarding-workflow
  • 00e8933: feat: launchNativeScreen
  • d7800bc: feat: create bridge launchNativeScreen
Files Processed (25)
  • FRW.xcodeproj/project.pbxproj (9 hunks)
  • FRW/Foundation/Bridge/BridgeModels.swift (1 hunk)
  • FRW/Foundation/Bridge/NativeScreenName.swift (1 hunk)
  • FRW/Foundation/Bridge/RCTNativeFRWBridge.mm (2 hunks)
  • FRW/Foundation/Bridge/RNBridgeError.swift (1 hunk)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift (1 hunk)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift (4 hunks)
  • FRW/Modules/Browser/View/Auth/AuthnViewModel.swift (1 hunk)
  • FRW/Modules/MultiBackup/View/BackupListView.swift (2 hunks)
  • FRW/Modules/MultiBackup/ViewModel/BackupListViewModel.swift (1 hunk)
  • FRW/Modules/Profile/ProfileView.swift (5 hunks)
  • FRW/Modules/Profile/ProfileViewModel.swift (3 hunks)
  • FRW/Modules/ReactNative/ReactNativeViewController.swift (5 hunks)
  • FRW/Modules/TransactionList/TransferListHandler.swift (1 hunk)
  • FRW/Modules/Wallet/AccountSwitch/AccountSwitchViewModel.swift (1 hunk)
  • FRW/Modules/Wallet/TokenDetail/TokenDetailView.swift (1 hunk)
  • FRW/Modules/Wallet/WalletAccount/WalletAccount+FlowWalletKit.swift (1 hunk)
  • FRW/Resource/en.lproj/Localizable.strings (1 hunk)
  • FRW/Services/Manager/Transaction/TransactionHolder.swift (1 hunk)
  • FRW/Services/Manager/UserManager.swift (3 hunks)
  • FRW/Services/Manager/Wallet/WalletManager.swift (1 hunk)
  • FRW/Services/Router/Coordinator.swift (1 hunk)
  • FRW/Services/Router/RouteMap+React.swift (2 hunks)
  • Podfile.lock (15 hunks)
  • main.jsbundle (0 hunks)
Actionable Comments (2)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [392-395]

    possible bug: "Variable shadowing causes incorrect error message."

  • FRW/Services/Manager/UserManager.swift [83-83]

    possible bug: "Potential thread-safety issue with shared mutable state."

Skipped Comments (6)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [104-107]

    possible issue: "Unused parameters in method signature."

  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [137-137]

    maintainability: "Inconsistent logging approach."

  • FRW/Foundation/Bridge/TurboModuleSwift.swift [251-253]

    possible issue: "Empty method implementation."

  • FRW/Modules/Wallet/AccountSwitch/AccountSwitchViewModel.swift [38-39]

    maintainability: "Commented-out code should be removed."

  • FRW/Modules/Browser/View/Auth/AuthnViewModel.swift [61-64]

    enhancement: "Logic can be simplified."

  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [22-23]

    best practice: "UI error handling mixed with business logic."

Comment on lines +392 to +395
guard let screen = NativeScreenName(rawValue: screen) else {
log.error("don't support route \(screen)")
HUD.error(title: "don't support route \(screen)")
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable screen is shadowed by the guard let statement. When the guard fails, the error message references the shadowed screen (which is the NativeScreenName? that failed to initialize, not the original String). Use a different variable name for the parsed screen name to preserve the original string for error reporting.

}

// It is only used when the bridge is called on page of onboard
var RNRegisterInfo:[String: String] = [:]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dictionary RNRegisterInfo is declared as a public var without any synchronization mechanism. If accessed from multiple threads (e.g., from React Native bridge calls and native code simultaneously), this could lead to race conditions. Consider using a thread-safe approach such as a serial dispatch queue, NSLock, or making it an actor-isolated property.

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (1)
  • f313559: Merge branch 'dev' into 310/972-ios-create-native-bridge-for-onboarding-workflow
Files Processed (25)
  • FRW.xcodeproj/project.pbxproj (9 hunks)
  • FRW/Foundation/Bridge/BridgeModels.swift (1 hunk)
  • FRW/Foundation/Bridge/NativeScreenName.swift (1 hunk)
  • FRW/Foundation/Bridge/RCTNativeFRWBridge.mm (2 hunks)
  • FRW/Foundation/Bridge/RNBridgeError.swift (1 hunk)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift (1 hunk)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift (4 hunks)
  • FRW/Modules/Browser/View/Auth/AuthnViewModel.swift (1 hunk)
  • FRW/Modules/MultiBackup/View/BackupListView.swift (2 hunks)
  • FRW/Modules/MultiBackup/ViewModel/BackupListViewModel.swift (1 hunk)
  • FRW/Modules/Profile/ProfileView.swift (5 hunks)
  • FRW/Modules/Profile/ProfileViewModel.swift (3 hunks)
  • FRW/Modules/ReactNative/ReactNativeViewController.swift (5 hunks)
  • FRW/Modules/TransactionList/TransferListHandler.swift (1 hunk)
  • FRW/Modules/Wallet/AccountSwitch/AccountSwitchViewModel.swift (1 hunk)
  • FRW/Modules/Wallet/TokenDetail/TokenDetailView.swift (1 hunk)
  • FRW/Modules/Wallet/WalletAccount/WalletAccount+FlowWalletKit.swift (1 hunk)
  • FRW/Resource/en.lproj/Localizable.strings (1 hunk)
  • FRW/Services/Manager/Transaction/TransactionHolder.swift (1 hunk)
  • FRW/Services/Manager/UserManager.swift (3 hunks)
  • FRW/Services/Manager/Wallet/WalletManager.swift (1 hunk)
  • FRW/Services/Router/Coordinator.swift (1 hunk)
  • FRW/Services/Router/RouteMap+React.swift (2 hunks)
  • Podfile.lock (15 hunks)
  • main.jsbundle (0 hunks)
Actionable Comments (1)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [390-395]

    possible bug: "Variable shadowing causes incorrect error message."

Skipped Comments (6)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [104-107]

    possible issue: "Unused parameters in method signature."

  • FRW/Foundation/Bridge/TurboModuleSwift.swift [251-253]

    possible issue: "Empty method implementation."

  • FRW/Services/Manager/UserManager.swift [83-83]

    possible bug: "Potential thread-safety issue with shared mutable state."

  • FRW/Modules/Wallet/AccountSwitch/AccountSwitchViewModel.swift [38-39]

    maintainability: "Commented-out code should be removed."

  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [137-140]

    best practice: "Debug print statement should use logging framework."

  • FRW/Resource/en.lproj/Localizable.strings [1205-1205]

    possible issue: "Localization key name doesn't match its usage context."

Comment on lines +390 to +395
static func launchNativeScreen(screen: String, params: String?) {
log.info("\(screen)")
guard let screen = NativeScreenName(rawValue: screen) else {
log.error("don't support route \(screen)")
HUD.error(title: "don't support route \(screen)")
return
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable screen is shadowed by the guard let statement. When the guard fails, the error message references the shadowed screen (which is nil since the initialization failed), not the original String parameter. Use a different variable name like nativeScreen for the parsed value to preserve the original string for error reporting.

guard let nativeScreen = NativeScreenName(rawValue: screen) else {
  log.error("don't support route \(screen)")
  HUD.error(title: "don't support route \(screen)")
  return
}

@lmcmz lmcmz merged commit b892ff3 into dev Jan 1, 2026
4 checks passed
@lmcmz lmcmz deleted the 310/972-ios-create-native-bridge-for-onboarding-workflow branch January 1, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] Create native bridge for onboarding workflow

3 participants