[LIVECOPY-312] getReferencedLiveCopyNodeById does not match the correct candidate Created: 12/Apr/22  Updated: 13/Oct/22  Resolved: 12/Oct/22

Status: Closed
Project: Live Copy
Component/s: None
Affects Version/s: 3.2.7
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Horst Loepprich Assignee: Andrei Ichimescu
Resolution: Cannot Reproduce Votes: 0
Labels: Livecopy
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to LIVECOPY-220 ItemNotFound in Push Master Changes 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
Date of First Response:
Epic Link: AuthorX Support
Team: AuthorX

 Description   

AS-IS:

  • it is possibel that getReferencedLiveCopyNodeById finds more than one candidate for a component copy
  • the filter tries to match the masterNode path with the candidate node path
  • the filter never matches if the paths contain the site name, e.g. /master/... and /travel/...
  • if no match is found, the first entry in the candidate list is returned
    Got more than 1 candidate for node /master/business/insurance/relatedContent/06 -> [node /it/business/Retail/relatedContent/06, node /it/business/insurance/relatedContent/06]. Using node /it/business/Retail/relatedContent/06
  • the first entry in the list may not be the candidate that should be further processed
    • e.g. candidate has different nodes than the original and reordering of child nodes fails
      WrappedException: javax.jcr.ItemNotFoundException: node /it/business/Retail/relatedContent/06 has no child node with name 05
    • this can be the case if the candidate was copied from another page, pasted to a new page and then modified

 

A possible solution for the filter would be to remove the site from the path before comparison:

Node resultNode = candidates.stream()
        .filter(n -> Exceptions.sneak().get(() ->
                masterPath.replaceFirst("^/\\w*", "")
                          .equals(n.getPath().replaceFirst("^/\\w*", ""))
        ))
        .findFirst()
        .orElse(candidates.get(0)); 

But this will only work if the rest of the path is the same as the master.

Another solution would be to skip the further processing of the node if the children do not match the master and display a warning to the user that a node was skipped. Currently the whole push process just fails with an error.



 Comments   
Comment by Jesus Alonso [ 09/Sep/22 ]

Hello hloepprich , would you mind to detail the steps to reproduce this issue?

Comment by Horst Loepprich [ 19/Sep/22 ]

Hi Jesus,

this error occurred when our customer copied a component from a live copy page to a non-live copy page, but we only noticed this later. The behavior was always reproducible through this process. However, the Pages-App must be configured to allow copying between pages.

Comment by Laura Delnevo [ 12/Oct/22 ]

Thank you hloepprich for your time today. As we couldn't replicate the issue anymore (on 6.2.8), as agreed, we are closing the ticket as "Cannot Reproduce".

// cc aichimescu jalonso miruela fmangold 

 

Generated at Mon Feb 12 02:27:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.