Skip to content
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

Fix prop dependent withOnyx updates + add test #98

Merged
merged 2 commits into from
Aug 17, 2021

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Aug 16, 2021

Details

cc @kidroca See this comment here -> #97 (comment)
We've caused a regression with prop dependent updates.

Related Issues

There are probably some if we've already started regressions.

Automated Tests

A new test to make sure withOnyx always works with prop dependent keys was added.

Linked PRs

Expensify/App#4676

@@ -87,20 +87,20 @@ export default function (mapOnyxToState) {
* @param {*} val
*/
setInitialState(statePropertyName, val) {
if (!this.state.loading) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly out of curiosity: why are we reversing this if?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic has changed from what we had before which was incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to invert the logic though it's just how I did it. Updated so this is unchanged but the logic is the same.

Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@luacmartins
Copy link
Contributor

Merging since this will remove the hold on a deploy blocker fix. Sorry @Gonals

@luacmartins luacmartins merged commit 57ca276 into master Aug 17, 2021
@luacmartins luacmartins deleted the marcaaron-fixUpdatedConnections branch August 17, 2021 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants