You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only keep awaits sequential when a later call genuinely uses an earlier result, or when the ordering is deliberate (rate-limited batches, retry loops, write-then-read).
92
92
93
+
## Carry exact lifecycle ownership across async boundaries
94
+
95
+
When asynchronous work can outlive an execution, session, or resource instance, capture its
96
+
opaque ownership token before the first `await` and pass that exact token through completion and
97
+
error cleanup. Never re-adopt the current owner from delayed cleanup: a replacement may now own
98
+
the same scope. End the lifecycle by exact-token match, and clear shared state only when that end
99
+
succeeds. Current-owner adoption is reserved for synchronous user actions that explicitly stop
100
+
the current lifecycle.
101
+
93
102
## Prefetch dynamic destination lists on intent
94
103
95
104
For long lists of dynamic destinations, do not viewport-prefetch every row and do not assume
@@ -99,6 +108,12 @@ server state with the consumer's shared React Query options. A short, cancelable
99
108
avoids drive-by downloads. Do not treat `touchstart` as intent because it also begins scrolling;
100
109
let the actual unmodified click start the data request.
101
110
111
+
A speculative failure must not poison a later visit when the app default disables
112
+
`retryOnMount`: remove only that exact failed query while it is inactive, keep failures visible
113
+
to mounted consumers, and set the shared options to `retryOnMount: true` so a quick-click failure
114
+
can recover after the user leaves and returns. Never carry placeholder data between protected
115
+
resource keys (for example, workspace A to workspace B); an explicit loading state is truthful.
116
+
102
117
If a continuity-focused surface intentionally omits `loading.tsx` so the current view remains
103
118
mounted until its peer is ready, the intent path must warm both the full route and its critical
104
119
data. Otherwise keep the loading boundary so dynamic navigation remains responsive.
0 commit comments