[Unresolved] Upgrading to beta 108/109 causes duplicate entries when editing and drafts not working as expected
Link to reproduction
No response
Environment Info
Binaries:
Node: 20.13.1
npm: 10.5.2
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
payload: 3.0.0-beta.109
next: 15.0.0-canary.160
@payloadcms/db-mongodb: 3.0.0-beta.109
@payloadcms/email-nodemailer: 3.0.0-beta.109
@payloadcms/graphql: 3.0.0-beta.109
@payloadcms/live-preview: 3.0.0-beta.109
@payloadcms/live-preview-react: 3.0.0-beta.109
@payloadcms/next/utilities: 3.0.0-beta.109
@payloadcms/plugin-redirects: 3.0.0-beta.109
@payloadcms/plugin-seo: 3.0.0-beta.109
@payloadcms/richtext-lexical: 3.0.0-beta.109
@payloadcms/translations: 3.0.0-beta.109
@payloadcms/ui/shared: 3.0.0-beta.109
react: 19.0.0-rc-5dcb0097-20240918
react-dom: 19.0.0-rc-5dcb0097-20240918
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.0.0: Mon Aug 12 20:52:41 PDT 2024; root:xnu-11215.1.10~2/RELEASE_ARM64_T6031
Available memory (MB): 36864
Available CPU cores: 14
Describe the Bug
Not sure what the workflow is when a previous issue got closed but is unresolved, so creating this issue for visibility.
Original bug is described here: https://github.com/payloadcms/payload/issues/8430
I am using mongo in my Payload setup. I have a pretty basic Pages collection and had a few page entries. After updating from beta v107 to v108, when editing a pre-existing page a duplicate entry for the same ID is shown which both link to the same entry:
Some observations:
Draft data is correctly saved, Publishing changes works and are shown as expected, Latest draft is not shown in preview but it instead shows a different fixed previous version, When creating a new entry in v108 no issues are observed.
The issue persists after updating to v109 as mentioned here: https://github.com/payloadcms/payload/issues/8430#issuecomment-2378452861
I had 1 old entry left created with v107, just updated from v108 to v109 and edited the page but it seems the issue still persists and I now have 3 duplicates:
Reproduction Steps
- Init project on beta.107
- Create and publish pages
- Update to beta.108
- Edit a previously published page => duplicate entry
- Update to beta.109
- Edit a (different) previously published page => triple entry
Adapters and Plugins
No response
I'm experiencing the same issue across all my projects; re-saving the duplicated entities, as mentioned in #8430, did not resolve the problem.
Facing the same issue It has to do something with the application layer. The duplicates are not in the DB, they happen when it queries the DB and populates the data.
Until they fix the underlying issue. The way that I've fixed it was to find all versions where the parent field was of $type: string and replace them with the ObjectId version instead.
Then I went into the admin UI and published all the pages with a duplicate page and that seems to have cleared it all up for me
Until they fix the underlying issue. The way that I've fixed it was to find all versions where the parent field was of $type: string and replace them with the ObjectId version instead.
Then I went into the admin UI and published all the pages with a duplicate page and that seems to have cleared it all up for me
In my case the parent is null in db
🚀 This is included in version v3.0.0-beta.110
Confirmed all good now, thanks 👍
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.