-
Notifications
You must be signed in to change notification settings - Fork 6
310/972 ios create native bridge for onboarding workflow #2022
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
310/972 ios create native bridge for onboarding workflow #2022
Conversation
PR SummaryImplemented 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 Changes
autogenerated by presubmit.ai |
There was a problem hiding this 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)
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."
There was a problem hiding this 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."
There was a problem hiding this 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)
- d28c43b: feat: onboarding
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."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
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."
There was a problem hiding this 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."
There was a problem hiding this 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)
- a3d7777: feat: update RN
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."
There was a problem hiding this 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."
There was a problem hiding this 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 (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."
There was a problem hiding this 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."
There was a problem hiding this 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."
| guard let screen = NativeScreenName(rawValue: screen) else { | ||
| log.error("don't support route \(screen)") | ||
| HUD.error(title: "don't support route \(screen)") |
There was a problem hiding this comment.
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.
There was a problem hiding this 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."
There was a problem hiding this 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
isShowCoamay change behavior when COA accounts are empty."
There was a problem hiding this 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 (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."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
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
.noneandOptional.none."
There was a problem hiding this 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)
There was a problem hiding this 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)
- 95493ad: feat: local
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."
There was a problem hiding this 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."
| guard let screen = NativeScreenName(rawValue: screen) else { | ||
| log.error("don't support route \(screen)") | ||
| HUD.error(title: "don't support route \(screen)") | ||
| return |
There was a problem hiding this comment.
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] = [:] |
There was a problem hiding this comment.
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.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this 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."
| 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 |
There was a problem hiding this comment.
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
}
Related Issue
Summary of Changes
Need Regression Testing
Risk Assessment
Additional Notes
Screenshots (if applicable)
Simulator.Screen.Recording.-.Tmp.-.2025-12-23.at.10.38.39.mov