Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version collection publish/unpublish changes are not directly reflected in the UI #9531

Closed
juliarn opened this issue Nov 26, 2024 · 5 comments · Fixed by #10405
Closed

Version collection publish/unpublish changes are not directly reflected in the UI #9531

juliarn opened this issue Nov 26, 2024 · 5 comments · Fixed by #10405
Assignees
Labels
area: ui Related to the admin panel.

Comments

@juliarn
Copy link

juliarn commented Nov 26, 2024

Describe the Bug.

When publishing or unpublishing a document in a version collection with drafts enabled, the UI does not directly show the status and data change, a manual reload is required. This is a quite relevant problem because it prevents interaction with the document on its most recent state, for example publishing directly after unpublishing is not possible without manually reloading the page.

Status bar before unpublishing (correct state):
Image

Status bar after unpublishing (outdated state):
Image

Status bar after a manual reload of the page (correct state):
Image

This also applies to the data itself, not just the published status. When using a Hook to generate data on publish (collection-level beforeChange Hook), the generated data is also only visible after manually reloading the page.
Another case where this is impeding interaction is when validation fails on publish. After doing this, the UI displays the document as published and thus disables the publish button. Like before, the correct state is shown again after reloading the page manually.

Reproduction Steps

This issue was produced with Payload running with the Next Dev Server.

  1. Create a collection with the following version configuration:
 versions: {
    drafts: {
      autosave: true,
      validate: false,
    },
  },
  1. Create a document of the collection and try to publish and unpublish it.

The collection I tested with also contained a Hook to generate data for a field, validations on some fields and access control.

Environment Info

Binaries:
  Node: 23.1.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: 9.14.2
Relevant Packages:
  payload: 3.1.1
  next: 15.0.0
  @payloadcms/db-postgres: 3.1.1
  @payloadcms/graphql: 3.1.1
  @payloadcms/next/utilities: 3.1.1
  @payloadcms/richtext-lexical: 3.1.1
  @payloadcms/translations: 3.1.1
  @payloadcms/ui/shared: 3.1.1
  react: 19.0.0-rc-65a56d0e-20241020
  react-dom: 19.0.0-rc-65a56d0e-20241020
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:00:32 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6030
  Available memory (MB): 18432
  Available CPU cores: 11
@juliarn juliarn added area: ui Related to the admin panel. status: needs-triage Possible bug which hasn't been reproduced yet labels Nov 26, 2024
@rilrom
Copy link
Contributor

rilrom commented Nov 26, 2024

Looks like a similar issue is happening in #9423

@juliarn
Copy link
Author

juliarn commented Nov 29, 2024

Looks like a similar issue is happening in #9423

I thought this might be the same issue, but my issue still persists with 3.2.2 unfortunately.

@JarrodMFlesch JarrodMFlesch self-assigned this Dec 2, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Dec 2, 2024
@chinmay-mehta
Copy link

+1 on this we are facing the same issue on our end as mentioned by the OP we are on payload 3.2.1. Any updates on when this is going to be picked up.

@cbratschi
Copy link

Happens with Payload 3.6.0 too. Only unpublish does not update the UI in my case. Video is attached.

Bildschirmaufnahme.2024-12-12.um.18.39.19.mov

@lctone
Copy link

lctone commented Dec 13, 2024

Yes, still bug in payload 3.6.0. Unpublish doesn't update Draft UI, need to refresh browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui Related to the admin panel.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants