Repository navigation
fix(content-releases): deleting an entry rewrites published releases - #28169
Conversation
AI-generated QA checklistScope / ImpactEE only ( Release-action cleanup on entry delete is now scoped to unreleased releases only (
Each now filters the release Three things drive the risk:
Manual QA
Edge Cases
Test Setup
Possible QA Automation
Assumptions / Gaps
QA ResolutionAdd |
2b5a5ad to
9a2dbed
Compare
giu1io
left a comment
There was a problem hiding this comment.
QA passed. I tested the PR as it is at 9a2dbed, comparing it with its parent be7c553, on EE with SQLite, Postgres and MySQL, and on CE. All 12 scenarios ran.
The fix
- Deleting a non-localized entry that a published release contains leaves that release
done, with its action andreleasedAtuntouched. On the parent, the same delete turned it intoemptywith 0 actions. - The same holds for a Content API delete, a bulk delete from the Content Manager, deleting one locale of a localized entry (the other locale's action stays too), and deleting a locale from the i18n settings.
- Postgres and MySQL behave the same as SQLite for the entry delete and the locale delete.
Unchanged
- Pending releases still lose the deleted entry's action and get their status recomputed (
readywith one fewer entry, orempty), and other entries' actions are kept. - Making an entry invalid still marks its pending release
blocked, and the published release staysdone. - On CE the delete works and the releases routes aren't mounted. No error is logged in any scenario.
Non-blocking:
- A done release now keeps the action of an entry that no longer exists, and the release details page shows that row as
undefined, with no action menu. On develop the action was deleted instead, and the release lost itsdonestatus, which is worse. The page's handling of a missing entry (ReleaseDetailsPage.tsx:623) predates this PR. - A release in
failedstatus is still treated as pending: deleting its entry removes the action and the status goes fromfailedtoempty. I'm not sure whether that's intended; the doc doesn't say. - The tests check the
whereobjects of mocked queries. An API test with an entry in both a published and a pending release would cover the real behaviour across databases. docs/docs/packages/core/content-releases/01-backend.md:238still says "all releases" are recalculated.
AI Assisted Comment
Deleting an entry removed its actions from every release, including released ones, then recomputed their status. A done release could turn empty or ready. #28023 widened this to every non-localized type. Scope the release lookup and the action delete to releases with releasedAt null, in the document middleware and the lifecycle hook.
9a2dbed to
697985a
Compare
|
Rebased on develop (24h rule), no change to the fix; no conflicts. |
Conflicts: - package.json files: keep design system 2.3.0-alpha.1 from the feature branch, take the 5.61.0 release versions from develop. - yarn.lock: feature lock reconciled with yarn install; develop's graphql-tools/utils and whatwg-node/promise-helpers resolutions kept. - database errors: export both SavepointError and InvalidBooleanError. - content-releases bootstrap and documents middleware: keep the feature's deletePlannedActions, which already limits entry deletes to releases that haven't run (#28169's intent); its test now asserts that filter. - content-releases backend docs: keep the feature wording, which already covers released releases keeping their actions.
Conflicts: - package.json files: keep design system 2.3.0-alpha.1 from the feature branch, take the 5.61.0 release versions from develop. - yarn.lock: feature lock reconciled with yarn install; develop's graphql-tools/utils and whatwg-node/promise-helpers resolutions kept. - database errors: export both SavepointError and InvalidBooleanError. - content-releases bootstrap and documents middleware: keep the feature's deletePlannedActions, which already limits entry deletes to releases that haven't run (#28169's intent); its test now asserts that filter. - content-releases backend docs: keep the feature wording, which already covers released releases keeping their actions.
What does it do?
Deleting an entry no longer changes releases that are already published. The release lookup and the action delete now only target releases with
releasedAt: null, in the Document Service middleware and in the lifecycle hook.Pending releases keep the current behaviour: the actions of the deleted entry are removed and the release status is computed again.
Why is it needed?
A published release is the record of what was published. Deleting an entry removed its actions from every release, published or not, and computed their status again. A
donerelease could become empty orready.#28023 extended the action filter to every non-localized content type, so this now happens on all content types with Draft & Publish. Localized content types already had the problem in 5.58.0.
How to test it?
EE, with content releases enabled.
done.done.Automated:
yarn test:unit server/src/middlewaresinpackages/core/content-releases.Related issue(s)/PR(s)
AI assisted