-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Refactor FXIOS-10467 - Remove force_cast violations from Utilities and applications support #23149
base: main
Are you sure you want to change the base?
Conversation
Client.app: Coverage: 30.84
Generated by 🚫 Danger Swift against 6688ee4 |
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.
Thank you @bmihai23 for this PR 👍 Added a couple minor comments but overall changes lgtm.
@@ -146,7 +146,9 @@ class UITestAppDelegate: AppDelegate, FeatureFlaggable { | |||
let output = URL(fileURLWithPath: "\(dirForTestProfile)/places.db") | |||
|
|||
let enumerator = FileManager.default.enumerator(atPath: dirForTestProfile) | |||
let filePaths = enumerator?.allObjects as! [String] | |||
guard let filePaths = enumerator?.allObjects as? [String] else { | |||
fatalError("Failed to cast enumerator.allObjects to [String] during filePaths extraction") |
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.
@bmihai23 Can we please double-check if there is any other way to handle this besides fatalError
? This will crash just like as!
, so this change really doesn't provide much benefit.
self.logger.log("Failed to cast task to BGAppRefreshTask", | ||
level: .fatal, | ||
category: .lifecycle) |
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.
This PR adds several new .fatal
logs; I think that's fine, since these would be crashes anyway. But @cyndichin @adudenamedruby please LMK if we have an official policy (or team plan) on how we're updating these force-cast violations.
📜 Tickets
Jira ticket
Github issue
💡 Description
force_cast
violations from:📝 Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)