immerjs / immerjs/immer

An error occurs when nesting patches and changing the level of [tree structure data]

Open
#916 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
881
PR merge metrics
No merged PRs in 30d

Description

🐛 Bug Report

An error occurs when nesting patches and changing the level of [tree structure data]

Link to repro

https://codesandbox.io/s/minimal-repro-forked-xvb93p

To Reproduce

1.remove a node
2.Add a new node where it was previously removed
3.Add previously deleted nodes to a subset of new nodes

Observed behavior

An error occurs when using nextData

Expected behavior

should not go wrong

Environment

immer verson :9.0.12

Use default configuration

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox using Immer 9.0.12 and reproduce the three listed tree-data operations. Then trace the nested-patch handling involved when nextData is used. Done means the reproduction no longer throws and the expected tree changes remain correct; no source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.