From ecdf26a1d10490036cd95bc4d8bf37cb9b34175e Mon Sep 17 00:00:00 2001 From: alex-pardes <105307164+alex-pardes@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:54:55 -0700 Subject: [PATCH] tree: Fix bug with loading detached field index (#22680) ## Description Fixed a bug in `DetachedFieldIndex.setRevisionsForLoadedData` where the newly created `DetachedField` entries incorrectly had a field named `latestRevision` instead of `latestRelevantRevision`. --- packages/dds/tree/src/core/tree/detachedFieldIndex.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/dds/tree/src/core/tree/detachedFieldIndex.ts b/packages/dds/tree/src/core/tree/detachedFieldIndex.ts index 02377695ab07..9dabb7fd6a53 100644 --- a/packages/dds/tree/src/core/tree/detachedFieldIndex.ts +++ b/packages/dds/tree/src/core/tree/detachedFieldIndex.ts @@ -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 = 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 }); });