Commit 3131f78
committed
fix(files): stop a content save from resurrecting a stale contentType
updateWorkspaceFileContent read the row before taking the FOR UPDATE lock, then
wrote that read's contentType back inside the transaction. A save overlapping a
type change therefore restored the pre-change type, leaving the file named .txt
while still stored as text/markdown.
A content write carries no opinion about the file's type unless the caller says
so, so the column is now only written when a contentType is supplied. The
live-doc markdown gate reads the committed row for the same reason.1 parent df2308c commit 3131f78
2 files changed
Lines changed: 46 additions & 2 deletions
File tree
- apps/sim/lib/uploads/contexts/workspace
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1389 | 1389 | | |
1390 | 1390 | | |
1391 | 1391 | | |
1392 | | - | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
1393 | 1398 | | |
1394 | 1399 | | |
1395 | 1400 | | |
| |||
1479 | 1484 | | |
1480 | 1485 | | |
1481 | 1486 | | |
1482 | | - | |
| 1487 | + | |
1483 | 1488 | | |
1484 | 1489 | | |
1485 | 1490 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
410 | 449 | | |
411 | 450 | | |
412 | 451 | | |
| |||
0 commit comments