Open SimYunSup opened 1 month ago
https://github.com/SimYunSup/example-list/tree/payload/bug-postgres-nested-id
Duplicated ID error when duplicate Array/Block that includes Array/Block.
Nested
nested-block
blocks
just-text
nested
title
nested-array
nestedArrayBlocks
nestedArrayArray
I think It must replace nested ID.
And I think Same in 3.0.0-beta.39 because DUPLICATE_ROW has same logic.
3.0.0-beta.39
DUPLICATE_ROW
2.18.3
@payloadcms/db-postgres@0.8.4, @payloadcms/bundler-webpack@1.0.6
Seeing the same issue with 3.0.0-beta.36 as well.
3.0.0-beta.36
Link to reproduction
https://github.com/SimYunSup/example-list/tree/payload/bug-postgres-nested-id
Describe the Bug
Duplicated ID error when duplicate Array/Block that includes Array/Block.
Reported Bug
```text [16:56:40] ERROR (payload): TypeError: Cannot read properties of undefined (reading 'nested_blocks_just_text_pkey') at upsertRow (D:\GithubProject\example-list\node_modules\.pnpm\@payloadcms+db-postgres@0.8.4_@types+react@18.3.3_payload@2.18.3_@swc+helpers@0.5.11_@types+r_utjmzo3j7ceboprn5scvypgwvm\node_modules\@payloadcms\db-postgres\src\upsertRow\index.ts:318:57) at processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.updateOne (D:\GithubProject\example-list\node_modules\.pnpm\@payloadcms+db-postgres@0.8.4_@types+react@18.3.3_payload@2.18.3_@swc+helpers@0.5.11_@types+r_utjmzo3j7ceboprn5scvypgwvm\node_modules\@payloadcms\db-postgres\src\update.ts:44:18) at async updateByID (D:\GithubProject\example-list\node_modules\.pnpm\payload@2.18.3_@swc+helpers@0.5.11_@types+react@18.3.3_esbuild@0.19.12_typescript@5.4.5_webpa_w2wwwoljy4lt2mm3kbswof65oi\node_modules\payload\src\collections\operations\updateByID.ts:269:16) at async updateByIDHandler (D:\GithubProject\example-list\node_modules\.pnpm\payload@2.18.3_@swc+helpers@0.5.11_@types+react@18.3.3_esbuild@0.19.12_typescript@5.4.5_webpa_w2wwwoljy4lt2mm3kbswof65oi\node_modules\payload\src\collections\requestHandlers\updateByID.ts:43:17) ```To Reproduce
Nested
collection item.nested-block
inblocks
just-text
innested
title
(optional)nested-array
inblocks
nested
title
(optional)nestedArrayBlocks
just-text
innested
title
(optional)nestedArrayArray
nested
title
(optional)I think It must replace nested ID.
And I think Same in
3.0.0-beta.39
becauseDUPLICATE_ROW
has same logic.Payload Version
2.18.3
Adapters and Plugins
@payloadcms/db-postgres@0.8.4, @payloadcms/bundler-webpack@1.0.6