Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 81d34df The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Docs preview: https://docs-site-pr-4639-data-client.vercel.app Built from 81d34df merged into |
|
Size Change: +188 B (+0.19%) Total Size: 97.7 kB 📦 View Changed
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Benchmark React
Details
| Benchmark suite | Current: 81d34df | Previous: 008d874 | Ratio |
|---|---|---|---|
data-client: getlist-100 |
436.21 ops/s (± 7.1%) |
305.11 ops/s (± 3.5%) |
0.70 |
data-client: getlist-500 |
122.74 ops/s (± 3.6%) |
83.65 ops/s (± 3.6%) |
0.68 |
data-client: update-entity |
766.28 ops/s (± 1.9%) |
719.42 ops/s (± 1.5%) |
0.94 |
data-client: update-user |
947.87 ops/s (± 6.3%) |
597.01 ops/s (± 3.1%) |
0.63 |
data-client: getlist-500-sorted |
119.05 ops/s (± 4.0%) |
76.02 ops/s (± 2.9%) |
0.64 |
data-client: update-entity-sorted |
1095.9 ops/s (± 4.9%) |
499.38 ops/s (± 2.4%) |
0.46 |
data-client: update-entity-multi-view |
860.22 ops/s (± 6.7%) |
634.92 ops/s (± 2.9%) |
0.74 |
data-client: list-detail-switch-10 |
33.15 ops/s (± 1.4%) |
16.26 ops/s (± 5.8%) |
0.49 |
data-client: update-user-10000 |
140.01 ops/s (± 2.9%) |
134.05 ops/s (± 2.7%) |
0.96 |
data-client: invalidate-and-resolve |
133.24 ops/s (± 2.3%) |
93.72 ops/s (± 3.1%) |
0.70 |
data-client: update-ticker-stream |
19.9 ops/s (± 2.3%) |
12.54 ops/s (± 1.6%) |
0.63 |
data-client: unshift-item |
483.68 ops/s (± 4.4%) |
371.75 ops/s (± 1.7%) |
0.77 |
data-client: delete-item |
811.52 ops/s (± 6.6%) |
608.83 ops/s (± 0.9%) |
0.75 |
data-client: move-item |
422.83 ops/s (± 4.3%) |
263.35 ops/s (± 7.2%) |
0.62 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4639 +/- ##
=======================================
Coverage 98.63% 98.64%
=======================================
Files 163 163
Lines 3161 3183 +22
Branches 627 633 +6
=======================================
+ Hits 3118 3140 +22
Misses 9 9
Partials 34 34 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 611d02510d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Staff engineer (Cursor agent): Resuming from One remaining change (dev-only, caused by this PR): Follow-up (after merge, not blocking): a Validated: |
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: 81d34df | Previous: 008d874 | Ratio |
|---|---|---|---|
normalizeLong |
731 ops/sec (±1.69%) |
761 ops/sec (±0.27%) |
1.04 |
normalizeLong Values |
627 ops/sec (±0.58%) |
634 ops/sec (±1.83%) |
1.01 |
normalizeLong Scalar |
570 ops/sec (±2.72%) |
564 ops/sec (±3.33%) |
0.99 |
normalizeLong Scalar update |
1666 ops/sec (±0.81%) |
1639 ops/sec (±2.14%) |
0.98 |
denormalizeLong |
331 ops/sec (±6.07%) |
354 ops/sec (±7.14%) |
1.07 |
denormalizeLong Values |
297 ops/sec (±5.22%) |
340 ops/sec (±4.48%) |
1.14 |
denormalizeLong donotcache |
1779 ops/sec (±1.85%) |
1815 ops/sec (±0.58%) |
1.02 |
denormalizeLong nested 25% missing |
357 ops/sec (±4.70%) |
364 ops/sec (±5.01%) |
1.02 |
denormalizeLong nested 25% null |
363 ops/sec (±4.61%) |
387 ops/sec (±4.52%) |
1.07 |
denormalizeLong nested 25% INVALID |
371 ops/sec (±4.44%) |
414 ops/sec (±4.59%) |
1.12 |
denormalizeLong Values donotcache |
1198 ops/sec (±4.38%) |
1282 ops/sec (±1.28%) |
1.07 |
denormalizeLong Scalar donotcache |
1834 ops/sec (±1.82%) |
1823 ops/sec (±1.31%) |
0.99 |
denormalizeShort donotcache 500x |
2530 ops/sec (±0.49%) |
2282 ops/sec (±0.68%) |
0.90 |
denormalizeShort 500x |
929 ops/sec (±6.04%) |
896 ops/sec (±6.84%) |
0.96 |
denormalizeShort 500x withCache |
9474 ops/sec (±1.72%) |
9285 ops/sec (±0.69%) |
0.98 |
queryShort 500x withCache |
5224 ops/sec (±1.77%) |
4892 ops/sec (±1.40%) |
0.94 |
buildQueryKey All |
84612 ops/sec (±2.94%) |
85419 ops/sec (±1.99%) |
1.01 |
query All withCache |
9416 ops/sec (±6.53%) |
9394 ops/sec (±4.83%) |
1.00 |
denormalizeLong with mixin Entity |
301 ops/sec (±7.19%) |
327 ops/sec (±7.11%) |
1.09 |
denormalizeLong withCache |
13399 ops/sec (±1.18%) |
12214 ops/sec (±1.16%) |
0.91 |
denormalizeLong withCache (Scalar churn) |
13349 ops/sec (±1.02%) |
12183 ops/sec (±0.94%) |
0.91 |
denormalizeLong nested 25% missing withCache |
11425 ops/sec (±0.77%) |
11489 ops/sec (±1.48%) |
1.01 |
denormalizeLong nested 25% null withCache |
12189 ops/sec (±0.37%) |
12254 ops/sec (±0.51%) |
1.01 |
denormalizeLong nested 25% INVALID withCache |
11718 ops/sec (±1.00%) |
11203 ops/sec (±0.82%) |
0.96 |
denormalizeLong Values withCache |
9185 ops/sec (±0.69%) |
9073 ops/sec (±0.50%) |
0.99 |
denormalizeLong Scalar withCache |
8164 ops/sec (±1.13%) |
9379 ops/sec (±1.03%) |
1.15 |
denormalizeLong Scalar update withCache |
5646 ops/sec (±1.41%) |
5803 ops/sec (±0.38%) |
1.03 |
denormalizeLong All withCache |
11956 ops/sec (±0.45%) |
11183 ops/sec (±1.07%) |
0.94 |
denormalizeLong Query-sorted withCache |
10101 ops/sec (±6.18%) |
9669 ops/sec (±5.12%) |
0.96 |
denormalizeLongAndShort withEntityCacheOnly |
2800 ops/sec (±1.63%) |
2750 ops/sec (±1.43%) |
0.98 |
denormalize bidirectional 50 |
6527 ops/sec (±10.95%) |
6450 ops/sec (±9.70%) |
0.99 |
denormalize bidirectional 50 donotcache |
68819 ops/sec (±3.26%) |
69728 ops/sec (±1.21%) |
1.01 |
getResponse |
6709 ops/sec (±6.09%) |
6970 ops/sec (±5.54%) |
1.04 |
getResponse (null) |
18460003 ops/sec (±1.58%) |
18475732 ops/sec (±1.22%) |
1.00 |
getResponse (clear cache) |
271 ops/sec (±10.80%) |
295 ops/sec (±9.89%) |
1.09 |
getSmallResponse |
5413 ops/sec (±1.26%) |
5846 ops/sec (±1.31%) |
1.08 |
getSmallInferredResponse |
4563 ops/sec (±0.54%) |
4277 ops/sec (±0.46%) |
0.94 |
getResponse Collection |
7379 ops/sec (±4.77%) |
6933 ops/sec (±3.39%) |
0.94 |
get Collection |
5266 ops/sec (±1.28%) |
5276 ops/sec (±1.09%) |
1.00 |
get Query-sorted |
8472 ops/sec (±3.79%) |
7971 ops/sec (±3.67%) |
0.94 |
setLong |
774 ops/sec (±0.50%) |
730 ops/sec (±0.28%) |
0.94 |
setLongWithMerge |
428 ops/sec (±1.57%) |
405 ops/sec (±0.98%) |
0.95 |
setLongWithSimpleMerge |
452 ops/sec (±1.99%) |
436 ops/sec (±0.41%) |
0.96 |
setSmallResponse 500x |
1563 ops/sec (±3.26%) |
1527 ops/sec (±0.38%) |
0.98 |
setMany 50x one-per-row |
212 ops/sec (±1.95%) |
205 ops/sec (±0.49%) |
0.97 |
setMany 50 batch |
6533 ops/sec (±0.39%) |
6085 ops/sec (±1.29%) |
0.93 |
setMany 500x one-per-row |
20.94 ops/sec (±3.71%) |
20.1 ops/sec (±2.53%) |
0.96 |
setMany 500 batch |
2746 ops/sec (±1.93%) |
2695 ops/sec (±0.85%) |
0.98 |
This comment was automatically generated by workflow using github-action-benchmark.
|
Both done in 44d28c2.
Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44d28c2ec9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 877aa2c259
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4eac13d. Configure here.
… pauses SubscriptionManager.cleanup() stopped every Subscription, and nothing restarted the ones that outlive the pause. Subscription gets an optional init() that resumes work cleanup() stopped; SubscriptionManager calls it from its own init(), and stops a Subscription created while paused until then. PollingSubscription implements it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5Z9ziZLXvEhvQd1y4Yx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5Z9ziZLXvEhvQd1y4Yx
…le paused A component remounted by StrictMode or <Activity> subscribes before DataProvider resumes the managers. A custom Subscription without init() could never resume, so stopping it would leave it stopped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5Z9ziZLXvEhvQd1y4Yx
…subscriptions SubscriptionManager.init() now resumes polls without a new SUBSCRIBE, so DevToolsManager must keep its polling counts through cleanup(). A remounted DataProvider that shares Managers binds a new controller. Polls from the old store would resume against it and swallow the new store's SUBSCRIBE, so the manager drops them on rebind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5Z9ziZLXvEhvQd1y4Yx
Like NetworkManager, a late UNSUBSCRIBE from an unmounted store that shares this manager must not remove the new store's subscription. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5Z9ziZLXvEhvQd1y4Yx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5Z9ziZLXvEhvQd1y4Yx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5Z9ziZLXvEhvQd1y4Yx
87f469c to
81d34df
Compare

Requested by Nathaniel · project thread
Motivation
Bug fix. An app polls an endpoint with
controller.subscribe(), with no component that owns the subscription, and an<Activity>aboveDataProviderhides it and later shows it again.SubscriptionManager.cleanup()stops everyPollingSubscriptionbut keeps tracking them. It has noinit(), so when the store resumes, polling stays stopped until the app unsubscribes.useSubscription()already recovers, because the hidden component unsubscribes and then subscribes again on show ("resumes polling after showing" inactivity.tsx). Found in a review of reactive/native-binance#47.Solution
Subscriptiongets an optionalinit()that resumes workcleanup()stopped and does nothing while the subscription is running. Because it is optional, custom Subscriptions keep compiling and keep their old behavior.SubscriptionManager.init()callsinit()on every subscription it tracks. A subscription created while the store is paused is stopped at once, if it hasinit(), and the nextinit()starts it. A subscription withoutinit()keeps running, as before, because nothing could resume it. This matters because a remounted component subscribes beforeDataProviderresumes the Managers.PollingSubscriptionimplementsinit(). Its publiccleanup()now marks it stopped, while going offline still only clears timers.run()does nothing while stopped, so adding a faster frequency while paused cannot restart polling.SubscriptionManager.middleware()binds a different controller, it cleans up and drops the subscriptions it tracks, and it passes on actions from the old controller untouched, likeNetworkManager. This happens when a remountedDataProviderreuses the same Managers. Without it, acontroller.subscribe()that outlived the old store would resume against the old controller and take in the new store's SUBSCRIBE for the same key, and a late UNSUBSCRIBE from the old store could stop the new store's polling.DevToolsManager.cleanup()keeps its polling counts.SubscriptionManager.init()resumes a poll without a new SUBSCRIBE, so clearing the counts would stop capping that key in__DC__.actions.Assumptions and validation
PollingSubscription.init()resumes polling, does nothing while already running, ignoresadd()while stopped, and waits for the connection to come online when resumed offline.SubscriptionManagerresumes every tracked subscription, stops one withinit()created while paused, and keeps one withoutinit()running. DevTools keeps capping a polling key aftercleanup()andinit().yarn jest --selectProjects ReactDOM Node --testPathPatterns 'packages/(core|react)'gives 759 passed.tsc -p packages/corepasses.SubscriptionManager.Goals impact
rdcClient.js+96 B,rdcNextjs.js+92 BSubscriptionManager, the same asNetworkManager. Other new code runs only on subscribe, pause, resume and store setup. The React benchmark shows only run-to-run spread.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y5C5Z9ziZLXvEhvQd1y4Yx