Commit 513db15
fix: copy-on-mutate frozen records in the save and source-resolve write paths
With typed structures disabled (storage.randomAccessFields off), decoded records
are classic-encoded and frozen by freezeData. Several write paths stamped
created/updated times and the primary key onto the record in place, which throws
("Cannot assign to read only property") when the record is frozen — e.g. when a
record decoded during transaction-log replay is re-saved. This surfaced broadly in
integration tests under the new default-off.
Records are intentionally immutable (5.2 record caching relies on it), so the fix
is copy-on-mutate: shallow-copy a frozen record before stamping it — in the table
save validate callback and the source/caching resolve write.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 65fad22 commit 513db15
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
1669 | 1675 | | |
1670 | 1676 | | |
1671 | 1677 | | |
| |||
4382 | 4388 | | |
4383 | 4389 | | |
4384 | 4390 | | |
| 4391 | + | |
| 4392 | + | |
| 4393 | + | |
| 4394 | + | |
4385 | 4395 | | |
4386 | 4396 | | |
4387 | 4397 | | |
| |||
0 commit comments