feat(tree): option to retain history - #27696
Merged
Merged
Conversation
Contributor
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (120 lines, 7 files), I've queued these reviewers:
How this works
|
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
Contributor
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
Joshua Smithrud (Josmithr)
approved these changes
Jul 15, 2026
Contributor
Bundle size comparisonBase commit: Notable changes
Per-bundle deltas
|
Noah Encke (noencke)
added a commit
that referenced
this pull request
Aug 21, 2026
## Description `retainHistory` on `SharedTreeOptions` was documented as causing growth in both memory and summaries/snapshots, but it only ever prevented trunk commits from being evicted from memory. Summaries continued to contain just the collaboration window, so retained history was discarded at the next summary and was unavailable to clients that loaded from it. This was an oversight, not an intentional design choice — confirmed against the original PR (#27696) that introduced the option, whose shipped changeset already documented the intended (summary-inclusive) behavior. Summaries produced by a client with `retainHistory` enabled now contain the full trunk. History accumulated while the flag is enabled survives summarization and is available to clients that join later. History from before the flag was enabled (already evicted in a prior session) cannot be recovered. There is no change to the default (`retainHistory: false`) behavior, and no change to the persisted format. New tests confirm 3 of them fail without the production fix (proving they exercise it); the full `@fluidframework/tree` suite (15,203 tests) passes with no regressions. ## Reviewer Guidance The review process is outlined in [the pull request guidelines](../docs/content/Contributing/PR-Guidelines.md#guidelines). This PR received an automated rigorous code-review pass; one test assertion was strengthened as a result (exact equality instead of `<=` on retained commit count).
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
Adds a new
retainHistoryflag toSharedTreeOptions(defaults tofalse).Setting
retainHistorytotruewill prevent SharedTree from garbage-collecting historical data about old changes.Note that this will cause unbounded growth both in memory on the client and in summaries/snapshots (the at-rest data representing a Fluid document). For these reasons, this option is only intended for debugging and experimentation.
This option is needed by an FF customer that is experimenting with history-management features.
Breaking Changes
None