Skip to content

fix(tree): RemainsToExist respects orphan delete-only-intended#437

Merged
steiler merged 1 commit into
mainfrom
fix/remains-to-exist-orphan-delete
May 22, 2026
Merged

fix(tree): RemainsToExist respects orphan delete-only-intended#437
steiler merged 1 commit into
mainfrom
fix/remains-to-exist-orphan-delete

Conversation

@steiler
Copy link
Copy Markdown
Collaborator

@steiler steiler commented May 22, 2026

Summary

  • Bug: LeafVariants.RemainsToExist() only treated non-delete variants as "still present", while CanDelete / ShouldDelete already treat DeleteOnlyIntended (orphan delete) as leaving the device value unchanged. Mandatory validation short-circuits on RemainsToExist(), so orphan deletes could incorrectly fail with errors such as mandatory child missing even though the device still holds the data.
  • Fix: Count variants with DeleteOnlyIntended set as remaining, matching the delete semantics used elsewhere, and add table tests for orphan delete with and without a running variant.

RemainsToExist ignored DeleteOnlyIntended, so mandatory validation
treated orphan-deleted leaves as removed and rejected transactions.
Match CanDelete/ShouldDelete and add regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@steiler steiler requested a review from a team as a code owner May 22, 2026 11:58
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@alexandernorth alexandernorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@steiler steiler merged commit 9e0804f into main May 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants