-
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 Sistem services & Logging #23150
base: main
Are you sure you want to change the base?
Conversation
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 🎉 just some nit things. Great work 🚀
import UIKit | ||
import Shared | ||
|
||
class MenuBuilderHelper { | ||
private let logger: Logger | ||
|
||
init(logger: Logger = DefaultLogger.shared) { |
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.
That looks good, i'd only move the init after the structs, so the init is with the other methods
@@ -255,7 +280,13 @@ class MenuBuilderHelper { | |||
|
|||
if #available(iOS 15, *) { |
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.
We can also remove the #if available
now we support from iOS 15
($0 as! UIKeyCommand).wantsPriorityOverSystemBehavior = true | ||
guard let fileMenuKeyCommand = $0 as? UIKeyCommand else { | ||
logger.log("Failed to cast file menu child to UIKeyCommand in MenuBuilderHelper class", | ||
level: .fatal, |
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.
i'd log those as a .info
level since there is no crash there and we don't send them to sentry as well.
Same for the other logs. i'd also use .lifecycle
i see there isn't a proper one for menu but i guess lifecycle is more general
self.alterEventForCustomCrash(event: event, crash: crashReport) | ||
} else { | ||
self.logger.log("Encountered an error that is not a CustomCrashReport: \(String(describing: event.error))", | ||
level: .fatal, |
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.
Also here i'd go to .info
📜 Tickets
Jira ticket
Github issue
💡 Description
force_cast
violations from:📝 Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)