Closed yobottehg closed 2 weeks ago
Hey @yobottehg I tested a few workflows here, on the latest beta and next canary 104+, with publishing and draft modes and in both mongo and postgres and I can't reproduce this.
Could you provide a reproduction please? Or more detailed steps?
@paulpopus
I found an easy way to reproduce this also using the demo:
I think this goes more into the direction on how to handle deleted references instead of being only a nested docs problem.
Thanks @yobottehg I followed those exact steps in both mongo and postgres on the latest beta and I couldn't get this to error, the referenced category is removed as expected in postgres
Can you test on the latest and let me know if you can still reproduce? Is there anything else related to your setup, eg hooks etc. that run?
@paulpopus I added a reproduction. Only tested locally with postgres.
My steps to reproduce were wrong. Issue only appears if the deleted reference is inside a block.
I added all necessary steps to reproduce to the onInit function here: https://github.com/yobottehg/payload/blob/beta-repro-7694/test/_community/config.ts#L26
Following this since I'm also dealing with this same error
Will be fixed in the next release via https://github.com/payloadcms/payload/pull/7977
We will throw an error to the UI explaining that the children are no longer passing validation.
In the future we'll look into how deleting references in this manner affects validation of where it's used.
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
Link to reproduction
Reproduction
Payload Version
3.0.0-beta.68
Node Version
20 LTS
Next.js Version
15.0.0-carary.57
Describe the Bug
When using the nested docs plugin and a parent document is published it tries to resave it's children.
If the children have invalid drafts the plugin fails to do so resulting in a lot of error messages and possible deadlocks (I have both in the logs.)
Shouldn't the nested-docs-plugin just re-publish the latest published version of the children instead with the new url instead of creating new published version of their drafts?
Reproduction Steps
Adapters and Plugins
nested-docs, db-postgres