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

UI: Make tree node modicifation detection more robust #1023

Merged
merged 4 commits into from
Mar 24, 2021

Conversation

roluk
Copy link
Member

@roluk roluk commented Mar 24, 2021

immer v8.0.2+ exposed a flaw in the way node additions/removals/modifications were detected via patches. The old implementation used to duplicate same node ids across multiple returned arrays, resulting in unnecessary React state updates.

The new approach aims to be more robust but is by no means perfect. The amount of code required to make it fully reliable would be unjustifiable as I wasn't able to come up with a test case that would break this new implementation.

Added some more tests to help catch future problems with immer.

@roluk roluk requested a review from saskliutas March 24, 2021 13:37
@roluk roluk self-assigned this Mar 24, 2021
@roluk roluk requested review from a team as code owners March 24, 2021 13:37
@roluk roluk enabled auto-merge (squash) March 24, 2021 14:55
@roluk roluk mentioned this pull request Mar 24, 2021
@roluk roluk merged commit ebbfb43 into master Mar 24, 2021
@roluk roluk deleted the ui-components/collect-model-changes branch March 24, 2021 16:11
@calebmshafer
Copy link
Member

@Mergifyio backport 2.14.x

@mergify
Copy link
Contributor

mergify bot commented Mar 25, 2021

Command backport 2.14.x: failure

No backport have been created

  • Backport to branch 2.14.x failed: Branch not found

@calebmshafer
Copy link
Member

@Mergifyio backport release/2.14.x

mergify bot pushed a commit that referenced this pull request Mar 25, 2021
@mergify
Copy link
Contributor

mergify bot commented Mar 25, 2021

Command backport release/2.14.x: success

Backports have been created

roluk added a commit that referenced this pull request Mar 25, 2021
(cherry picked from commit ebbfb43)

Co-authored-by: Robert Lukasonok <70327485+roluk@users.noreply.github.com>
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.

4 participants