-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[BEEEP] Add error handling for ElectronStore errors #17724
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
base: main
Are you sure you want to change the base?
Conversation
|
New Issues (1)Checkmarx found the following issues in this Pull Request
|
|
Claude finished @trmartin4's task —— View job Review UpdateI've reviewed the recent changes since my last review. The commit "Added log on delete error" addressed my previous feedback about logging cleanup failures. SummaryThe implementation looks solid overall. The error handling is comprehensive and the test coverage is excellent at 97.82%. FindingsFinding 1: PR title contains "[BEEEP]" placeholder 💭 The PR title includes "[BEEEP]" which appears to be a placeholder. Consider updating to a more descriptive title like "[Platform] Add error handling for ElectronStore errors" or similar. Finding 2: Missing test coverage line is acceptable The codecov report shows 1 missing line in Positive Observations
Previous Review ItemsMy previous review comments have been addressed:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17724 +/- ##
==========================================
+ Coverage 41.60% 41.65% +0.04%
==========================================
Files 3553 3553
Lines 102390 102423 +33
Branches 15366 15368 +2
==========================================
+ Hits 42602 42662 +60
+ Misses 57995 57966 -29
- Partials 1793 1795 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dani-garcia
left a comment
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.
Looks good to me overall.
I think backing up the corrupt file is a good idea that would allow us to debug the corruption issues better, though I'm also a bit concerned about potentially duplicating the data into a file that we don't keep track of.
That means any operation that would generally delete the user data consistently (like logging off) now may leave behind a corrupted copy of the data. Should we consider cleaning them up in the background once they're old?


🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-27943
📔 Objective
Prevent application crashes when there are values in the
ElectronStorethat cannot be deserialized.Before this change, data that could not be deserialized caused the application to crash with a stack trace shown below.
With this change in place, when an invalid
data.jsonis detected onElectronStoreinitialization, the service will:data.json.corrupt.${Date.now()}data.json.Some considerations
🤔 Is backing this up to a
corruptbackup the right option here? Should we back up this data and risk duplicating data that the user wishes to keep only indata.jsonversus proliferating in different files that need to be cleaned up?📸 Screenshots
Example of error:
With handling on initialization to move to
data.corrupt.json:⏰ 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