Description
Let say we have a rule in nodetype.cnd file
[a:RolloutConfig] > mix:title orderable - a:trigger (string) mandatory + * (a:LiveSyncAction) mandatory [a:LiveSyncAction] > nt:unstructured
When a package(first) is installed where parent node's(rolloutconfigs) .content.xml has:
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal" jcr:mixinTypes="[rep:AccessControllable]" jcr:primaryType="sling:OrderedFolder" jcr:title="Rollout Configurations"> <default/> <pushonmodify/> <activate/> <deactivate/> </jcr:root>
and default node's has .content.xml
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:a="http://www.day.com/jcr/a/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" a:trigger="rollout" jcr:description="abc" jcr:primaryType="a:RolloutConfig" jcr:title="Standard rollout config"> <contentUpdate jcr:primaryType="a:LiveSyncAction"/> <contentCopy jcr:primaryType="a:LiveSyncAction"/> <contentDelete jcr:primaryType="a:LiveSyncAction"/> <referencesUpdate jcr:primaryType="a:LiveSyncAction"/> <personalizationContentRollout jcr:primaryType="a:LiveSyncAction"/> </jcr:root>
Installing another package(second) with the same cnd file but with different child node's(default node) content.xml:
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:a class="code-quote">"http://www.day.com/jcr/a/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" a:trigger="rollout" jcr:description="abc" jcr:primaryType="a:RolloutConfig" jcr:title="Standard rollout config"> <activate jcr:primaryType="a:LiveSyncAction"/> <contentCopy jcr:primaryType="a:LiveSyncAction"/> </jcr:root>
marks the below node for Deletion but doesn't delete them because it's a mandatory node
D /x/y/z/rolloutconfigs/default/contentDelete D /x/y/z/rolloutconfigs/default/contentUpdate D /x/y/z/rolloutconfigs/default/orderChildren D /x/y/z/rolloutconfigs/default/personalizationContentRollout D /x/y/z/rolloutconfigs/default/referencesUpdate
The issue lies at https://github.com/apache/jackrabbit-filevault/blob/jackrabbit-filevault-3.2.8/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java#L1190 . Here, check for the child node is mandatory or not is done after marking it for delete importInfo.onDeleted(path) which gives wrong information that the child node is deleted but in the repository, it still exists.