antvis / antvis/X6

undo redo 节点数据丢失问题

Open
#4,302 5 comments 0 reactions 0 assignees View on GitHub
oscp type: bug 缺陷
Dominant language
TypeScript
Stars
6.7k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

在对节点进行undo/redo操作时,一旦undo将节点删除,再redo将节点还原,节点修改过的数据就会丢失。

### Your Example Website or App

https://codesandbox.io/p/sandbox/reverent-flower-38qz45

### Steps to Reproduce the Bug or Issue

1.打开页面,自动添加节点
2.点击change按钮,更改节点数据
3.点击get按钮,获取节点数据 20-20
4.点击undo按钮,撤销数据更改
5.点击undo按钮,撤销节点添加
6.点击redo按钮,还原节点添加
7.点击redo按钮,还原数据更改
8.点击get按钮,获取节点数据 10-10

### Expected behavior

8点击get按钮,获取节点数据 20-20

### Screenshots or Videos

_No response_

### Platform

- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- @antv/x6 [2.18.1]
- @antv/x6-plugin-history [2.2.4]

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the sequence in the linked CodeSandbox using @antv/x6 2.18.1 and @antv/x6-plugin-history 2.2.4, and inspect the history behavior around node removal and restoration. Done means the node retains its changed 20-20 data after the second redo and the final get action.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.