Commit 96d0549
fix: replace db.refresh() with re-fetch after commit
AsyncSession objects become detached after commit(), so db.refresh()
fails. Replace all refresh() calls with re-fetching the object using
select() query after commit.
Fixes net::ERR_CONNECTION_ABORTED error in upload endpoint.
Affected endpoints:
- POST /api/firmware/upload
- POST /api/firmware/entries
- PUT /api/firmware/entries/{id}
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>1 parent 9af2f6a commit 96d0549
1 file changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
| |||
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
222 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
223 | 227 | | |
224 | 228 | | |
225 | 229 | | |
| |||
386 | 390 | | |
387 | 391 | | |
388 | 392 | | |
389 | | - | |
390 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
391 | 402 | | |
392 | 403 | | |
393 | 404 | | |
| |||
415 | 426 | | |
416 | 427 | | |
417 | 428 | | |
418 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
419 | 432 | | |
420 | 433 | | |
421 | 434 | | |
| |||
0 commit comments