Remove ForestSummaryTrackingState#26468
Open
CraigMacomber wants to merge 3 commits intomicrosoft:mainfrom
Open
Remove ForestSummaryTrackingState#26468CraigMacomber wants to merge 3 commits intomicrosoft:mainfrom
CraigMacomber wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the ForestSummaryTrackingState enum and derives the state from whether trackedSummaryProperties is undefined instead. This refactoring eliminates redundant mutable state and prevents potential invalid states where the two could become out of sync.
Changes:
- Removed the
ForestSummaryTrackingStateenum and associated type definition - Replaced the
forestSummaryStatefield with a derivedisSummarizinggetter - Simplified validation functions by removing redundant state checks
- Updated all test assertions to use the new
isSummarizingproperty
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/dds/tree/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts | Removed ForestSummaryTrackingState enum, replaced forestSummaryState field with isSummarizing getter, simplified validation functions |
| packages/dds/tree/src/test/feature-libraries/forest-summary/incrementalSummaryBuilder.spec.ts | Updated all test assertions to use builder.isSummarizing instead of builder.forestSummaryState |
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Remove ForestSummaryTrackingState and derive it from trackedSummaryProperties===undefined instead.
This remove mutable state, and remove possible invaid states, removing the need for mutations and validation to maintain and ensure it is kept in sync.
Reviewer Guidance
The review process is outlined on this wiki page.