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

Client Side Live Preview isn't running afterRead hooks #8730

Closed
MatthiasGrandl opened this issue Oct 16, 2024 · 1 comment
Closed

Client Side Live Preview isn't running afterRead hooks #8730

MatthiasGrandl opened this issue Oct 16, 2024 · 1 comment
Labels
area: core Core Payload functionality invalid-reproduction status: needs-triage Possible bug which hasn't been reproduced yet v3

Comments

@MatthiasGrandl
Copy link

Describe the Bug

I am using AfterRead hooks to populate same data across my collections. Now I tried setting up client side live preview (because setting up versioning on existing collections was very buggy) and I stumbled across the fact that AfterRead hooks don't seem to be executed when the new data for live preview is calculated. This results in an inconsistent live preview whenever fields with afterRead hooks are edited.

Link to the code that reproduces this issue

too much work setting up a repro

Reproduction Steps

Set up live preview. Add a afterRead hook which changes the return value. notice how the return value doesn't change when editing the field in live preview.

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

area: core

Environment Info

Binaries:
  Node: 22.9.0
  npm: 10.8.3
  Yarn: 1.22.22
  pnpm: 9.12.1
Relevant Packages:
  payload: 3.0.0-beta.111
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030
  Available memory (MB): 36864
  Available CPU cores: 11
@MatthiasGrandl MatthiasGrandl added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Oct 16, 2024
@github-actions github-actions bot added the area: core Core Payload functionality label Oct 16, 2024
Copy link

We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate.

Why was this issue marked with the invalid-reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@beta -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

Useful Resources

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Core Payload functionality invalid-reproduction status: needs-triage Possible bug which hasn't been reproduced yet v3
Projects
None yet
Development

No branches or pull requests

1 participant