-
Notifications
You must be signed in to change notification settings - Fork 88
Bugfix/use onyx infinite loading collection #673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix/use onyx infinite loading collection #673
Conversation
|
@kacper-mikolajczak Dont forget to add checklist and testing/videos @DylanDylann can you please test in App and review? |
|
Sure |
|
@DylanDylann PR is ready for review. I've added all the recordings except iOS and Android native due to some remote build issues. |
| // since there are none matched. In withOnyx() we wait for all connected keys to return a value before rendering the child | ||
| // component. This null value will be filtered out so that the connected component can utilize defaultProps. | ||
| if (matchingKeys.length === 0) { | ||
| if (mapping.key && !isCollectionKey(mapping.key)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kacper-mikolajczak I think we should still keep the mapping.key check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've traced down what addNullishStorageKey method does and it only action it does is adding a key to nullishStorageKeys which is a Set primitive.
Do you think we should not be able to add undefined or null into nullishStorageKeys?
If yes, what do you think of moving this check into addNullishStorageKey, as it can decide on its own what to accept?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should not be able to add undefined or null into nullishStorageKeys?
nullishStorageKeys is to save the key that its value is nullish. In case the key is nullish and I think we should not add it to nullishStorageKeys
If yes, what do you think of moving this check into addNullishStorageKey, as it can decide on its own what to accept?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to keep it as before (keeping mapping.key check). It will be safer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
LOL, sorry! :D I've fixed the urls |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2025-08-12.at.15.02.37.movAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
mountiny
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me, what do you think @chuckdries
chuckdries
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!

Details
Problem
The useOnyx hook is experiencing an infinite loading state when subscribing to collection keys that don't exist in storage.
Solution
Remove conditional check from subscribeToKey that prevents collections to be treated equally as other keys in terms of empty state identification (nullishStorageKeys). (source)
Related Issues
GH_LINK
Automated Tests
Manual Tests
In regards to testing this change, we should be convinced there are no collections that are not loading correctly, so launching the app and checking collections should be enough (apart from unit tests added).
Author Checklist
### Related Issuessection aboveTestssectiontoggleReportand 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
android-web.mov
iOS: Native
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov