-
Notifications
You must be signed in to change notification settings - Fork 549
Fix handling of deleted TreeNodes #24345
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
packages/dds/tree/src/shared-tree/checkoutFlexTreeView.ts:73
- [nitpick] Consider using a more descriptive error message (e.g., 'View has already been disposed') to improve debugging clarity.
assert(!this.disposed, "disposed");
packages/dds/tree/src/feature-libraries/flex-tree/flexTreeTypes.ts
Outdated
Show resolved
Hide resolved
…s.ts Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of docs fixes/suggestions but otherwise approving for docs.
Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for docs
// Calling this is a performance improvement, however, do this only after demand to avoid momentarily having no anchors to anchorNode | ||
anchorForgetters?.get(this.node)?.(); | ||
if (!allowDeleted) { | ||
assertFlexTreeEntityNotFreed(this.#hydrationState.innerNode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: unrelated to this PR, but should this function be renamed to assertFlexTreeEntityNotDeleted
? The doc comment for the function also seems to say Assert entity is not deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the flex tree abstraction, we have isFreed which this is referring to, so I think its fine. Probably would be nice to better along the terminology in the two layers though.
Description
Fix invalid caching of TreeNodes across view disposal.
Fix asserts instead of usage errors when accessing disposed nodes.
Make errors more robust by centralizing error logic in node kernel's lookup.
Add some additional validation internally.
Clarify docs on TreeNodeStatus.Deleted
Reviewer Guidance
The review process is outlined on this wiki page.