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

Add logs to show why Onyx data is changing. Prevent updates when simple values change. #188

Merged
merged 3 commits into from
Oct 6, 2022

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Oct 4, 2022

Details

  • Adds some debugging setState() call data to Onyx that is opt-in
  • Avoids some minor re-renders when values that are already in React component state are the same as the ones we are about to pass. This check is looking for strict equality only and will not do a value comparison on objects or arrays.

Related Issues

https://github.com/Expensify/Expensify/issues/230464

Automated Tests

A small automated test was added.

Linked PRs

https://github.com/Expensify/App/compare/marcaaron-debugOnyxSetState

…o update

Add test

add dequal and debug setState calls

remove throw

Add setState logging methods

remove dequal for now

new PR

Only include difference not previous/new value

Remove dequal stuff

Fix test

Change param to use so we dont clash with the metrics
@marcaaron marcaaron self-assigned this Oct 4, 2022
@marcaaron marcaaron marked this pull request as ready for review October 5, 2022 19:05
@marcaaron marcaaron requested a review from a team as a code owner October 5, 2022 19:05
@melvin-bot melvin-bot bot requested review from grgia and removed request for a team October 5, 2022 19:06
@grgia grgia merged commit 96d879e into main Oct 6, 2022
@marcaaron marcaaron deleted the marcaaron-whyDidOnyxUpdate branch October 6, 2022 17:37
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.

2 participants