Skip to content

Bulk Delete Leaves One Item #15100

@martinwoo7

Description

@martinwoo7

Describe the Bug

In Payload 3.70.0 (and below), using bulk delete on records in a collection always leaves the last record (or one of the records) undeleted. This is reflected in the database as well.

Link to the code that reproduces this issue

https://github.com/martinwoo7/test-delete

Reproduction Steps

I've included a link to a repo but all I did was create a new Payload app using the website template - I haven't changed any code at all.

Image Image Image Image

In the admin panel, delete all the records in Categories collection and all but one will be deleted. Refreshing the page doesn't remove it and checking the database also shows the item still exists.

This happens with Vercel Postgres, using both Neon database and Supabase

Which area(s) are affected?

db: vercel-postgres

Environment Info

Binaries:
  Node: 22.15.1
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.70.0
  next: 15.4.10
  @payloadcms/db-vercel-postgres: 3.70.0
  @payloadcms/drizzle: 3.70.0
  @payloadcms/graphql: 3.70.0
  @payloadcms/live-preview: 3.70.0
  @payloadcms/live-preview-react: 3.70.0
  @payloadcms/next/utilities: 3.70.0
  @payloadcms/plugin-form-builder: 3.70.0
  @payloadcms/plugin-nested-docs: 3.70.0
  @payloadcms/plugin-redirects: 3.70.0
  @payloadcms/plugin-search: 3.70.0
  @payloadcms/plugin-seo: 3.70.0
  @payloadcms/richtext-lexical: 3.70.0
  @payloadcms/translations: 3.70.0
  @payloadcms/ui/shared: 3.70.0
  react: 19.2.1
  react-dom: 19.2.1
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 16311
  Available CPU cores: 16

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions