Skip to content

Cannot clean up versions for Globals #11879

Closed
@arku3

Description

@arku3

Describe the Bug

When using Versions on Globals and set a max, the clean up always fails after reaching.

Link to the code that reproduces this issue

https://github.com/arku3/payloadcms-versions-bug-report/

Reproduction Steps

The "Header" (src/Header/config.ts) have set the following:

{
versions: {
    max: 2,
    drafts: true,
 }
}
  1. start dev server
  2. Login admin
  3. Go to "Globals" > "Header", make changes and save draft a few times
  4. ERROR: There was an error cleaning up old versions for the global header is logged on the console
  5. Click on "Versions" tab and it should keep growing.

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Binaries:
  Node: 20.18.3
  npm: 10.8.2
  Yarn: N/A
  pnpm: 10.3.0
Relevant Packages:
  payload: 3.31.0
  next: 15.2.3
  @payloadcms/email-nodemailer: 3.31.0
  @payloadcms/graphql: 3.31.0
  @payloadcms/live-preview: 3.31.0
  @payloadcms/live-preview-react: 3.31.0
  @payloadcms/next/utilities: 3.31.0
  @payloadcms/payload-cloud: 3.31.0
  @payloadcms/plugin-form-builder: 3.31.0
  @payloadcms/plugin-nested-docs: 3.31.0
  @payloadcms/plugin-redirects: 3.31.0
  @payloadcms/plugin-search: 3.31.0
  @payloadcms/plugin-seo: 3.31.0
  @payloadcms/richtext-lexical: 3.31.0
  @payloadcms/translations: 3.31.0
  @payloadcms/ui/shared: 3.31.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: linux
  Arch: arm64
  Version: #1 SMP Tue Nov 5 00:19:58 UTC 2024
  Available memory (MB): 24111
  Available CPU cores: 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions