-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tree): Resolve several inconsistencies in allowsRepoSuperset and …
…isRepoSuperset (#22999) ## Description Fixes several bugs/inconsistencies in `allowsRepoSuperset` and `isRepoSuperset` and adds unit tests for this behavior. ## Bugs 1. Forbidden fields should not be convertible to required fields, but `isRepoSuperset` allowed this conversion. 2. The production codepath did not correctly handle queries between value schema nodes and other types of nodes (without the added code in `comparison.ts`, one could hit `0x893` directly below) 3. `isRepoSuperset` did not previously permit addition of new node kinds ## Context `allowsRepoSuperset` is the current implementation used by the production codepath to check compatibility between a document's stored and view schema. There is ongoing work on the schema evolution front to transition this codepath to one which is more flexible / easily debugged, which is the logic in `discrepancies.ts`. The general philosophy behind `discrepancies.ts` is to split the compatibility check into two parts: one bit of code which detects all differences between view and stored schema, and another bit of code which decides if any of those differences should prohibit document operations (read, write, upgrade schema, etc). This PR helps bring the newer implementation to parity with what we have today. --------- Co-authored-by: Abram Sanderson <[email protected]>
- Loading branch information
Showing
3 changed files
with
222 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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