Skip to content

Outdated updatedAt values in edit view #10039

Closed

Description

@franciscolourenco

Describe the Bug

There are 2 related but maybe independent issues in this report:

  1. After saving a document with drafts disabled (or publishing a document with drafts enabled), the value of useField({path: 'updateAt'}) remains outdated until you reload the page. This is a regression from v2 or an earlier v3 version.
1.Outdated.useField.path-.updateAt.mp4
  1. In collections with drafts enabled, the "Last Modified" date shoes the modification of the published version, not of the draft. I would expect to see the modified date of the version that is currently being displayed.
2.Last.Modified.shows.published.at.mp4

Link to the code that reproduces this issue

https://github.com/payloadcms/payload/compare/franciscolourenco:reproduce-updated-at

Reproduction Steps

1. Outdated useField({path: 'updateAt'})

  1. Publish a post
  2. Edit the post
  3. Publish the post again
  4. Observe that the updatedAt value unexpectedly didn't change in the custom component
  5. Reload the page
  6. Observe that the updatedAt value is now correct in the custom component

2. "Last Modified" displays modification date of published document instead of draft

  1. Publish a post
  2. Wait a minute
  3. Edit the post
  4. Save as a draft
  5. Observe that "Last Modified" shoes the modification date of the published version, not the draft.

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

area: ui

Environment Info

Payload: v3.8.0
Next: 15.0.3
Node: v21.6.2

Activity

  1. added
    status: needs-triage
    validate-reproduction
    on Dec 18, 2024
  2. added and removed
    validate-reproduction
    on Dec 18, 2024
  3. removed
    status: needs-triage
    on Dec 30, 2024
  4. franciscolourenco commented on Jan 8, 2025

    @franciscolourenco
    ContributorAuthor

    Issue 1. has been fixed by #10268 🎊

    Closing this one and opening new issue only with 2: #10436

  5. github-actions commented on Jan 10, 2025

    @github-actions
    Contributor

    This issue has been automatically locked.
    Please open a new issue if this issue persists with any additional detail.

  6. locked as resolved and limited conversation to collaborators on Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions