Skip to content

Commit

Permalink
tree: Fix bug with loading detached field index (microsoft#22680)
Browse files Browse the repository at this point in the history
## Description

Fixed a bug in `DetachedFieldIndex.setRevisionsForLoadedData` where the
newly created `DetachedField` entries incorrectly had a field named
`latestRevision` instead of `latestRelevantRevision`.
  • Loading branch information
alex-pardes authored Sep 30, 2024
1 parent dd433df commit ecdf26a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/dds/tree/src/core/tree/detachedFieldIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,13 @@ export class DetachedFieldIndex {
0x9bd /* revisions should only be set once using this function after loading data from a summary */,
);

const newDetachedNodeToField = new Map();
const newDetachedNodeToField: NestedMap<Major, Minor, DetachedField> = new Map();
const rootMap = new Map();
forEachInNestedMap(this.detachedNodeToField, ({ root }, major, minor) => {
setInNestedMap(newDetachedNodeToField, major, minor, { root, latestRevision });
setInNestedMap(newDetachedNodeToField, major, minor, {
root,
latestRelevantRevision: latestRevision,
});
rootMap.set(root, { major, minor });
});

Expand Down

0 comments on commit ecdf26a

Please sign in to comment.