-
Notifications
You must be signed in to change notification settings - Fork 80
[PM-26063] Replace BitwardenErrors with FlightRecorderErrors in FlightRecorder #2088
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
Conversation
|
Claude finished @matt-livefront's task —— View job Code Review Complete ✅Todo List:
Summary of ChangesThis PR successfully replaces
Files Changed:
Critical Issues Found🔴 Missing Test Coverage for New Error Extensions (lines 108-162)Location: Issue: The new Why this matters:
Recommendation: /// `FlightRecorderError.errorCode` returns stable error codes
func test_flightRecorderError_errorCode() {
XCTAssertEqual(FlightRecorderError.dataUnavailable.errorCode, 1)
XCTAssertEqual(FlightRecorderError.deletionNotPermitted.errorCode, 2)
XCTAssertEqual(FlightRecorderError.fileSizeError(BitwardenTestError.example).errorCode, 3)
XCTAssertEqual(FlightRecorderError.logLifecycleTimerError(BitwardenTestError.example).errorCode, 4)
XCTAssertEqual(FlightRecorderError.logNotFound.errorCode, 5)
XCTAssertEqual(FlightRecorderError.removeExpiredLogError(BitwardenTestError.example).errorCode, 6)
XCTAssertEqual(FlightRecorderError.writeMessageError(BitwardenTestError.example).errorCode, 7)
}
/// `FlightRecorderError.errorDomain` returns the correct domain
func test_flightRecorderError_errorDomain() {
XCTAssertEqual(FlightRecorderError.errorDomain, "FlightRecorderError")
}
/// `FlightRecorderError.errorUserInfo` includes underlying errors
func test_flightRecorderError_errorUserInfo() {
let underlyingError = BitwardenTestError.example
let error = FlightRecorderError.fileSizeError(underlyingError)
let userInfo = error.errorUserInfo
XCTAssertEqual(userInfo["Error Type"] as? String, String(reflecting: error))
XCTAssertNotNil(userInfo[NSUnderlyingErrorKey])
}
/// `FlightRecorderError` equatable works correctly for simple cases
func test_flightRecorderError_equatable_simple() {
XCTAssertEqual(FlightRecorderError.dataUnavailable, .dataUnavailable)
XCTAssertNotEqual(FlightRecorderError.dataUnavailable, .logNotFound)
}
/// `FlightRecorderError` equatable works correctly for associated value cases
func test_flightRecorderError_equatable_associatedValues() {
let error1 = FlightRecorderError.fileSizeError(BitwardenTestError.example)
let error2 = FlightRecorderError.fileSizeError(BitwardenTestError.example)
let error3 = FlightRecorderError.fileSizeError(NSError(domain: "test", code: 1))
XCTAssertEqual(error1, error2)
XCTAssertNotEqual(error1, error3)
}📊 Coverage Impact AnalysisCurrent Codecov report shows:
The missing 6 lines are likely:
These extensions are publicly accessible through protocol conformance and should be tested to ensure stability. ❌ Code Issues & Improvements1.
|
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2088 +/- ##
=======================================
Coverage 85.28% 85.29%
=======================================
Files 1695 1695
Lines 144592 144618 +26
=======================================
+ Hits 123319 123351 +32
+ Misses 21273 21267 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

🎟️ Tracking
PM-26063
📔 Objective
Updates the usages of
BitwardenErrorwithinFlightRecorderto useFlightRecorderError. This provides more consistency around flight recorder errors and removes theBitwardenErrordependency prior to moving the flight recorder into BitwardenKit.⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes