Skip to content

Stale data on backward/forward navigation #13390

@Janisvb

Description

@Janisvb

Describe the Bug

  1. When opening a collection item from the items list, changing a field, and pressing the back button of the browser, the value in the list shows the old value
  2. When changing a field, navigating to another page and pressing the back button of the browser, the field shows the old value

Image

While the first case is only annoying, the second case can easily lead to data loss by overwriting your updates with stale data.

Link to the code that reproduces this issue

https://github.com/janisvb/payload-reproduction

Reproduction Steps

pnpm dev _community

  1. Navigate to http://localhost:3000/admin/collections/posts
  2. Open "example post"
  3. Change example post to new post and save
  4. Press back button of browser. List still shows example post as title
  5. Press forward button of browser. Title field shows example post instead of new post

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

area: ui

Environment Info

payload: 3.50.0
next: 15.4.4
react: 19.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions