[PUBLISHING-49] Publishing inconsistently runs in different contexts Created: 04/Jun/18  Updated: 05/May/22  Resolved: 05/May/22

Status: Closed
Project: Publishing
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Roman Kovařík Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PUBLISHING-46 Recursive publication is not changing... Closed
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
Team: Nucleus

 Description   

private List<Node> collect(Node toPublish, Context ctx) throws RepositoryException {
   List<Node> result = new ArrayList<>();

   if (isRecursive()) {
     if (getVersionMap() != null) {
        result = collectFromVersionMap(versionMap, ctx); //system context(BaseVersionManager#getVersionedNode(javax.jcr.Node))
     } else {
       result = collectRecursively(toPublish); //user context (info.magnolia.jcr.util.NodeUtil#getNodes(javax.jcr.Node, org.apache.jackrabbit.commons.predicate.Predicate))
     }
   } else {
     if (StringUtils.isNotEmpty(getVersion())) {
      toPublish = versionManager.getVersion(toPublish, getVersion());  //system context(BaseVersionManager#getVersionedNode(javax.jcr.Node))
    }
    result.add(toPublish); //system context (from info.magnolia.commands.impl.BaseRepositoryCommand#getJCRNode)
   }
   return result;
}

info.magnolia.publishing.sender.DefaultSender#updateMetaData then differentiates between system and user context JCR sessions, but in some cases this is the same session.
Publications started form workflow run always in system context so maybe the differentiating (= not running everything in the system context) just make things more complicated.
The behaviour should be consistent no matter of recursive flag (ideally the same behaviour as in the legacy activation module).



 Comments   
Comment by Roman Kovařík [ 05/May/22 ]

Closing due to the amount of other high priority tickets. Please reopen if needed.

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