From f0f9077d847737b3d0ba387af901f0ff2a155de9 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Wed, 13 Mar 2024 11:45:34 +0100 Subject: [PATCH] fix: add comment --- packages/postgrest-core/src/fetch/dedupe.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/postgrest-core/src/fetch/dedupe.ts b/packages/postgrest-core/src/fetch/dedupe.ts index 0027bafa..021d2b06 100644 --- a/packages/postgrest-core/src/fetch/dedupe.ts +++ b/packages/postgrest-core/src/fetch/dedupe.ts @@ -9,6 +9,8 @@ export const dedupeGroupedPathsRecursive = ( const dedupeCounters = new Map(); return grouped.map((p, idx, a) => { + // never dedupe non-nested paths because even if there is a duplicate we always want to dedupe the nested path instead + // e.g. inbox_id,inbox_id(name) should be deduped to inbox_id,d_0_inbox_id:inbox_id(name) if (!isNestedPath(p)) return p; // dedupe current nested path if there is another path with the same `path`