Commit c8c3df8
Fix: Skip all optimistic state from persisting transactions, not just synced keys
The previous fix only skipped re-applying optimistic state for keys that were
just synced. This failed when the key itself changed (e.g., temp ID -1234 →
server ID 1000), because changedKeys.has(mutation.key) would return false.
Now we skip re-applying optimistic state for ALL mutations in persisting
transactions. This ensures that when a mutation handler writes server data
via sync functions, that data becomes visible immediately without being
masked by stale optimistic state.
This fixes the issue where temp IDs would persist even after the server
returned real IDs.
Co-authored-by: Sam Willis <[email protected]>1 parent f4826f0 commit c8c3df8
1 file changed
+9
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
672 | 681 | | |
673 | 682 | | |
674 | 683 | | |
675 | 684 | | |
676 | 685 | | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | 686 | | |
689 | 687 | | |
690 | 688 | | |
| |||
0 commit comments