Skip to content

Commit fad61e5

Browse files
authored
fix: exclude cross-product children from flat page list to prevent duplicate search objectIDs (#59587)
1 parent 8c71b29 commit fad61e5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/frame/lib/page-data.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,14 @@ export async function loadPageList(
383383

384384
if (!item.childPages) return
385385
await Promise.all(
386-
item.childPages.map(
387-
async (childPage: UnversionedTree) => await addToCollection(childPage, collection),
388-
),
386+
item.childPages
387+
// Cross-product children are pages included from other parts of the
388+
// tree via absolute `/content/` paths in a bespoke landing page's
389+
// children list. They already exist in their original location, so
390+
// including them again would create duplicate entries in the flat
391+
// page list which breaks search-index uniqueness constraints.
392+
.filter((childPage: UnversionedTree) => !childPage.crossProductChild)
393+
.map(async (childPage: UnversionedTree) => await addToCollection(childPage, collection)),
389394
)
390395
}
391396

0 commit comments

Comments
 (0)