Skip to content
Source
Sign inSign up
TanStack/db

fix(react-db): keep paced callbacks tied to committed renders #2170

Mergedzanmlakar(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/2170/headmerged by KyleAMathews

Showing 5 changed files with 122 additions and 1 deletion (loading 2).

x
0 of 5 viewed, 5 left
5 additions and 0 deletions.changeset/tidy-documents-commit.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/react-db': patch
+---
+​
+Keep `usePacedMutations` callbacks tied to the latest committed render so suspended transitions cannot mutate or persist another document's data. Refresh callbacks before descendant layout effects run while preserving the stable mutate function.
99 additions and 0 deletionsdocs/contributing/oracle-reviews/pr-2170-react-paced-render-cuts.mdAdded
View file
@@ -0,0 +1,99 @@
+# PR #2170 React paced-mutation render-cut review
+​
+Reviewed product commit: `6d176225cdcac2547ec04c7df86c0a5b8bc0c88f`.
+Oracle repair commit: `0e3214d12a47cd14cfc06046709847765452076e`.
+Base: `ce0b4a98061e335f7aeb144283c7679d6fdc6529`.
+The production repair already existed at the reviewed commit. This follow-up
+replaces its example-only tests with an independent React receiving oracle and
+updates the coverage map.
+​
+## Law and result
+​
+`usePacedMutations` exposes callbacks from the latest committed render. A
+render that suspends cannot replace the callbacks used by the visible
+component. A render that commits publishes its callbacks before descendant
+layout effects. The returned mutate function keeps its identity across a
+callback-only commit.
+​