-
Notifications
You must be signed in to change notification settings - Fork 547
Name collisions from structurally named schema now error #24707
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
Merged
CraigMacomber
merged 13 commits into
microsoft:main
from
CraigMacomber:structurallyCollide
May 27, 2025
Merged
Name collisions from structurally named schema now error #24707
CraigMacomber
merged 13 commits into
microsoft:main
from
CraigMacomber:structurallyCollide
May 27, 2025
Conversation
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
CraigMacomber
commented
May 23, 2025
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.
Pull Request Overview
This PR enforces unique structurally named schemas by comparing input and existing definitions and throws a UsageError
on mismatch.
- Introduces a shared helper (
getStructuralType
) inschemaFactory.ts
to validate and cache structural types for arrays and maps. - Adds unit tests (
schemaFactory.spec.ts
) for single- and multi-type collisions to ensure errors are thrown on mismatches. - Adds a changelog entry (
.changeset/social-bears-deny.md
) documenting the breaking change.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/dds/tree/src/test/simple-tree/api/schemaFactory.spec.ts | Adds tests for single and multi-type schema collisions. |
packages/dds/tree/src/simple-tree/api/schemaFactory.ts | Implements getStructuralType to detect and error on collisions. |
.changeset/social-bears-deny.md | Documents the new error behavior for structurally named schemas. |
Comments suppressed due to low confidence (1)
packages/dds/tree/src/simple-tree/api/schemaFactory.ts:994
- [nitpick] The variable name
same
is generic; consider renaming it to something more descriptive liketypesMatch
orschemasEqual
to clarify its role in the comparison.
const same = compareSets({ a: inputTypes, b: outputTypes });
packages/dds/tree/src/test/simple-tree/api/schemaFactory.spec.ts
Outdated
Show resolved
Hide resolved
Josmithr
reviewed
May 23, 2025
Josmithr
reviewed
May 23, 2025
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Joshua Smithrud <[email protected]>
Co-authored-by: Joshua Smithrud <[email protected]>
Co-authored-by: Copilot <[email protected]>
Josmithr
reviewed
May 23, 2025
Josmithr
reviewed
May 23, 2025
Co-authored-by: Joshua Smithrud <[email protected]>
…r/FluidFramework into structurallyCollide
Josmithr
approved these changes
May 23, 2025
Josmithr
approved these changes
May 27, 2025
This was referenced May 27, 2025
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
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.
Description
See changeset.
Breaking Changes
Some malformed schema which previously behaved incorrectly will now err.
Reviewer Guidance
The review process is outlined on this wiki page.