[PUBLISHING-57] Publishing with subnodes fails when one of them is for deletion Created: 30/Apr/19  Updated: 29/Mar/22  Resolved: 06/Sep/19

Status: Closed
Project: Publishing
Component/s: None
Affects Version/s: 1.0.7
Fix Version/s: 1.0.8, 1.1.2

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2019-04-30-13-24-03-380.png     PNG File image-2019-04-30-13-25-59-033.png     PNG File image-2019-04-30-13-29-15-559.png     PNG File image-2019-04-30-13-30-40-922.png    
Issue Links:
Relates
relates to PUBLISHING-149 Publishing including children marked ... Closed
relates to PUBLISHING-63 Publish recursively and modified only... Closed
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Epic Link: Support
Sprint: Maintenance & Releases
Story Points: 3
Team: Nucleus

 Description   

Timebox for investigation: 3 SP

Description:

When having a tree of nodes, for example pages, if we delete one of them and publish the whole tree (publish with subnodes), nodes processed after the deleted one won't be published but unpublished, which make it fail and appear as unpublished. Here's how to reproduce:

  • We have the following pages tree:

  • Delete pageToBeDeleted and modify titles from root page (remove it) and from sub3

  • Publish pageToBeDeleted including sub nodes. If we debug it we'll see that first page processed is the root, then pageToBeDeleted and the rest of the subtree, which means that changes in subtree won't be reflected (i.e. after the deletion

  • In the public instance we can see that, as expected, only changes in root and deleted page are there but not in the subtree:

 

Setting log level to DEBUG in the public instance for info.magnolia.publishing.transactional.receiver.operation.jcr.JcrTransactionUnpublicationOperation we can see following traces:

javax.jcr.ItemNotFoundException: 65fefc8b-18c3-4c1a-ad63-6564e0cec916
...
Caused by: org.apache.jackrabbit.core.state.NoSuchItemStateException: 65fefc8b-18c3-4c1a-ad63-6564e0cec916

This problem appears in info.magnolia.publishing.sender.AbstractSender.send(List<Node>, Rule, boolean) method, specifically in these lines (154-155):

publication = publication && !NodeUtil.hasMixin(node, NodeTypes.Deleted.NAME);
Optional<SendOperation> operation = publication ? getOperationByName(PUBLISH) : getOperationByName(UNPUBLISH);

when any of the nodes is marked for deletion, publication will be always false for the next nodes, which will be traduced as an unpublish operation for all of them. Therefore, it ends up causing the exception shown above when trying to remove the node.

 


Generated at Mon Feb 12 10:34:59 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.