Commit eba1dad
committed
Retry loading better-sqlite3 before failing database open
Loading the native better-sqlite3 binary can fail transiently with
"The paging file is too small for this operation to complete" under
Windows virtual memory pressure (MAILSPRING-CLIENT-9). The require()
was previously a top-level import, so this failure was an unhandled
exception unrelated to the database file, yet it was indistinguishable
from a corrupt database and left the app stuck without explanation.
Retry the module load a few times before giving up, and if it still
fails, report a clear, actionable error instead of treating it as an
unrecoverable database error (which would wipe and resync local data
for a problem that has nothing to do with the database itself).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DzBiH9WKXBG4BU6QGUxqTM1 parent 427c402 commit eba1dad
1 file changed
Lines changed: 43 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
51 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
52 | 93 | | |
53 | | - | |
| 94 | + | |
54 | 95 | | |
55 | 96 | | |
56 | 97 | | |
| |||
0 commit comments