test(client-tree): unimplemented "minimize" post-processor#27633
Conversation
Creates a "minimize" placeholder for transaction post-process functionality.
Unit tests are added to cover the intended new functionality with unsupported tests disabled. (Since implementation is not expected to change observable result tests for observable result can be enabled with the simple do-nothing implementation that is the placeholder.)
```text
transaction minimize post-processor
✔ can be supplied as a transaction post-processor without error
✔ preserves the observable result across an async transaction
self-tests - no minimization applicable
✔ embeds surviving markers but not transient marker for a purely additive scenario
✔ result carries no build when pre-existing content is only rearranged
✔ result carries no build when pre-existing content is only removed
✔ reflects the order of only-rearranged inserted nodes and keeps every build
preserves the observable result
✔ keeps inserted nodes
✔ nets a create-then-remove to no change
✔ keeps only the persisted node when a transient node is also created
✔ reflects only the final value of a node replaced within the transaction
✔ reflects only the surviving node when inserted content is relocated then removed
✔ keeps the surrounding nodes when a node in the middle of an inserted run is removed
✔ keeps the surrounding nodes when an inserted node is moved then removed
✔ keeps only the trailing node when a moved node and its successor from leading node are removed
✔ keeps only the leading node when a moved node and its insertion companion are removed
✔ leaves pre-existing content unchanged when a transient node is inserted then removed
✔ keeps pre-existing content and the surviving inserted node
✔ reflects only the final value of a field set multiple times
✔ reflects only the final empty array when only item's value of a field is set and then the item is removed
removes extraneous data from the squashed change (expected to fail until minimize is implemented)
- drops the build and destroy for a create-then-remove
- keeps only the persisted node's build when a transient node is also created
- keeps only the final node's build when a node is replaced
- keeps only the surviving node's build when inserted content is relocated then removed
- keeps the surrounding builds when a node in the middle of an inserted run is removed
- drops the build for an inserted node that is moved then removed
- keeps only the trailing node's [modified] build when a moved node and its successor from leading node build are removed
- keeps only the leading node's build when a moved node and its insertion companion are removed
- carries no build for a transient insert over pre-existing content
- keeps only the surviving inserted node's build over pre-existing content
- keeps only the final value's build when a field is set multiple times
- carries no build when only item's value of a field is set and then the item is removed
```
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (1808 lines, 12 files), I've queued these reviewers:
How this works
|
…nge in a transaction Revamp test infrastructure to provide Tree access to new schema change transaction scenarios.
(add blank line before steps lists)
Fixes comma insertion between `ABC` (previously -> `A,BC`; now -> `A,B,C`)
| }); | ||
| }); | ||
|
|
||
| // These tests only assert the observable end state of the document. Minimization must never change the |
There was a problem hiding this comment.
This comment is out of date. I think that sentence is unnecessary TBH.
There was a problem hiding this comment.
Seems appropriate still. It is odd to be able to have any passing tests for an implementation that doesn't provide value.
There was a problem hiding this comment.
I agree the explanation ("Minimization must never change...") is good. I just meant the first sentence which seems redundant with the describe block title (plus it's not hard to see the pattern in the tests themselves). Re being out of date, I meant that the test do more than assert the observable end state of the document.
There was a problem hiding this comment.
Hmm. I think that is really all this describe block currently does. The current view is checked (to have specific content/structure) and the op is partially checked. Other describe blocks do more.
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
Bundle size comparisonBase commit: Notable changesNo bundles changed by ≥ 500 bytes parsed. Per-bundle deltas
|
Creates a "minimize" placeholder for transaction post-process functionality.
Unit tests are added to cover the intended new functionality with unsupported tests disabled. (Since implementation is not expected to change observable result tests for observable result can be enabled with the simple do-nothing implementation that is the placeholder.)
Additionally bumps
treetest lib to ES2022 so thatString.replaceAllis available.