Skip to content

Commit

Permalink
Include new database corruption check for SQL errors
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Jun 30, 2021
1 parent 759ced3 commit 3b44447
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 7 additions & 2 deletions ts/sql/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,14 @@ function _updateJob(id: number, data: ClientJobUpdateType) {
`SQL channel job ${id} (${fnName}) failed in ${end - start}ms`
);

if (error && error.message && error.message.includes('SQLITE_CORRUPT')) {
if (
error &&
error.message &&
(error.message.includes('SQLITE_CORRUPT') ||
error.message.includes('database disk image is malformed'))
) {
window.log.error(
'Detected SQLITE_CORRUPT error; restarting the application immediately'
`Detected corruption. Restarting the application immediately. Error: ${error.message}`
);
window.restart();
}
Expand Down
4 changes: 0 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15754,10 +15754,6 @@ rimraf@^3.0.2, rimraf@~3.0.2:
dependencies:
glob "^7.1.3"

"ringrtc@https://github.com/signalapp/signal-ringrtc-node.git#0956fdc542cb7d1a0f3a06f28b8966adf359bb61":
version "2.10.6"
resolved "https://github.com/signalapp/signal-ringrtc-node.git#0956fdc542cb7d1a0f3a06f28b8966adf359bb61"

"ringrtc@https://github.com/signalapp/signal-ringrtc-node.git#868f7ecb699b984171b5ad02f9b043bfa55ad804":
version "2.10.6"
resolved "https://github.com/signalapp/signal-ringrtc-node.git#868f7ecb699b984171b5ad02f9b043bfa55ad804"
Expand Down

0 comments on commit 3b44447

Please sign in to comment.