undo 가 add/copy 덮어쓴 값을 유실하는 문제 수정 (#200)#201
Merged
Merged
Conversation
기존 object 멤버를 덮어쓰는 add/copy 의 inverse 가 항상 remove 로 계산되어 undo 시 이전 값이 유실됐다. inverseOp 에서 대상 부모가 object 이고 최종 key 가 이미 존재하면 replace(old value), 배열 삽입과 신규 key 는 종전대로 remove 로 계산한다. root path 도 replace 로 복원. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #200
문제 (S0)
기존 object 멤버를 덮어쓰는
add/copy의 inverse 가replace(old value)가 아니라remove로 계산되어, undo 시 이전 값이 조용히 유실됐다.{ history: N }로 undo 를 켠 정상 사용 경로에서 발생한다.수정
inverseOp의 add/copy 케이스:replace(old value)remove""→replace("", before)computeRootObjectAddInverses가 이미 쓰던objectHasOwn판정과 동일한 논리를 genericinverseOp로 일반화했다.검증
tests/regression/issue-200-undo-overwrite-add-inverse.test.ts5 케이스 (덮어쓰기 add/copy, 신규 key add, 배열 삽입, nested)🤖 Generated with Claude Code