Commit d56cbc8
fix: cap diff size to prevent SQLite/V8 crash on large files
apply_patch deleting a binary file (e.g. a 142 MB DMG) called
createTwoFilesPatch on the full file content, producing a 380 MB
diff string that was stored verbatim in part.data. When any query
loaded all rows for that session Node's sqlite StatementSync::All
tried to convert the 380 MB buffer to a V8 string, hitting an
internal V8 assertion and crashing the sidecar.
- apply_patch.ts: skip diff generation for deleted files larger
than 512 KB (binary files have no useful unified diff anyway).
- edit.ts trimDiff: return "" for any diff already over 512 KB,
guarding all callers against unexpectedly large inputs.
Also manually truncated the offending DB row
(prt_e1826dea2001zbyfymhOP3BOom, 380 MB → 201 bytes).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 16d893c commit d56cbc8
2 files changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
169 | 175 | | |
170 | 176 | | |
171 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| 638 | + | |
| 639 | + | |
638 | 640 | | |
| 641 | + | |
639 | 642 | | |
640 | 643 | | |
641 | 644 | | |
| |||
0 commit comments