Skip to content

404 Error - Media Upload + Read Replica #13588

@frederichoule

Description

@frederichoule

Describe the Bug.

Occasionally, when a user uploads media through the richtext-lexical upload popover, Payload triggers a 404 and redirects the user to another page. As a result, the user loses all unsaved changes.

This likely occurs because the read replica hasn’t yet synchronized the newly uploaded media item.
When it happens, Payload redirects to: /admin/collections/media?notFound=(id)&limit=10

Using the browser’s Back button only restores the last saved version, not the in-progress version the user was writing.

Reproduction Steps

  1. Create a new Payload instance that uses pgsql + read replicas.
  2. Create a new entry in a collection that includes a richtext-lexical field.
  3. Use the upload feature to add a new media item (e.g., an image).
  4. Once the upload completes, the popover closes and you return to the richtext-lexical editor.
  5. Every once in a while, Payload will trigger a 404 error and redirect the user to /admin/collections/media?notFound=(id)&limit=10

Environment Info

payload: 3.51.0
Node: 22.18.0
next: 15.4.6

Metadata

Metadata

Assignees

Labels

Bugarea: uiRelated to the admin panel.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions