Skip to content

Conversation

@daesunp
Copy link
Contributor

@daesunp daesunp commented Oct 23, 2025

Description

This PR adds support for the "delete" keyword in object nodes.

Breaking Changes

None

@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree base: main PRs targeted against main branch labels Oct 23, 2025
Copy link
Contributor

@noencke noencke left a comment

Choose a reason for hiding this comment

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

We should document this behavior somewhere. I think it would go on the docs for the TreeObjectNode type. Make sure this new behavior is documented and doesn't conflict with any existing docs.

@daesunp daesunp marked this pull request as ready for review October 29, 2025 13:53
@daesunp daesunp requested review from a team as code owners October 29, 2025 13:53
Copilot AI review requested due to automatic review settings October 29, 2025 13:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for using the delete operator on optional fields in ObjectNodes, making it functionally equivalent to assigning undefined to those fields.

Key Changes:

  • Replaced error-throwing deleteProperty handler with implementation that calls applyFieldChange with undefined
  • Refactored field assignment logic into a new applyFieldChange helper function
  • Updated test from expecting an error to validating the delete behavior
  • Added documentation explaining field assignment and deletion semantics

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/dds/tree/src/simple-tree/node-kinds/object/objectNode.ts Implements delete support via new applyFieldChange helper and updated proxy deleteProperty handler
packages/dds/tree/src/test/simple-tree/node-kinds/object/objectNode.spec.ts Updates test to validate delete behavior instead of expecting error
.changeset/fifty-crabs-add.md Documents the new feature for changelog

: (targetToProxy.get(from.node) ?? fail("missing proxy"));
const inner = getInnerNode(proxy);
const storedSchema = inner.context.schema.nodeSchema.get(brand(schema.identifier));
assert(storedSchema instanceof ObjectNodeStoredSchema, "Expected ObjectNodeStoredSchema");
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

When writing asserts (from @fluidframework/core-utils), please use a string literal for the error message, not a hex assert code. This instruction should only apply to newly added asserts, not existing ones.

Copilot generated this review using guidance from repository custom instructions.
@daesunp daesunp merged commit 31dca54 into microsoft:main Oct 29, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: dds: tree area: dds Issues related to distributed data structures base: main PRs targeted against main branch changeset-present

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants