[POC] useOnyx subscribed - v2#809
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a850e026a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (!subscribed) { | ||
| return NOOP |
There was a problem hiding this comment.
Keep paused hooks connected to hydrate and invalidate
When subscribed: false is used, this early return skips connectionManager.connect, so the hook no longer keeps the Onyx connection open. If a component mounts paused for a key that is not already in cache, no initial subscription callback ever loads/marks the key as loaded, leaving it stuck in loading; for cached keys, background writes also cannot invalidate the snapshot cache, so resuming can briefly render stale data until the async reconnect callback runs. The paused path should keep the connection and only suppress the render trigger.
Useful? React with 👍 / 👎.
Details
Related Issues
GH_LINK
Linked E/App PR
Automated Tests
Manual Tests
Author Checklist
### Related Issuessection above### Linked E/App PRsection above, and verified this change against it (E/App CI passed and manual testing completed)TestssectiontoggleReportand notonIconClick)myBool && <MyComponent />.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)Avataris modified, I verified thatAvataris working as expected in all cases)mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari