forked from nylas/nylas-mail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[client-app] Correctly handle db malformed errors in main process
Summary: This commit addressess issue T8135, which prevents the app from starting. This was happening because when 3111c16 landed, we added database access from the main (backend) electron process to be able to read the identity now stored in the database: nylas@3111c166#diff-1efa26fa0ae1603366b2c0033d971028R44 However, we omitted to add any error handling, so if the database failed to open due to a database malformed error (which it does: https://sentry.io/nylas/nylas-mail/?query=is%3Aunresolved+release%3A2.0.14+malformed&statsPeriod=14d), the app will just fail to start, given that this happens during the initialization of the main process. Additionally, the fact that we had no error handling increased the error reports for malformed errors given that we would never handle them, so every-time we opened the app we would report the same error This commit adds the same error handling we have in the DatabaseStore and moves the code around so it's available both in the main and renderer processes. After this commit, if the database fails to open during main process initialization, due to malformed errors or others, we will correctly inform the user that the database is corrupted, rebuild it, and restart the app. Test Plan: manually throw errors during setup, verify that we handle them correctly Reviewers: mark, spang, evan, halla Reviewed By: evan, halla Differential Revision: https://phab.nylas.com/D4431
- Loading branch information
Showing
5 changed files
with
73 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters