Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
456 stars 604 forks source link

JCR Compare showing incorrect Urls in comparison #1913

Closed saurabh14nov closed 5 years ago

saurabh14nov commented 5 years ago

Required Information

Expected Behavior

While trying to compare the same path in AEM localhost e.g.- /content/en/for-you/broadband-nbn/home-broadband using the JCR compare should show the below comparison:

/content/en/for-you/broadband-nbn/home-broadband/jcr:content /content/en/for-you/broadband-nbn/home-broadband/moving-home/jcr:content /content/en/for-you/broadband-nbn/home-broadband/plans/jcr:content
/content/en/for-you/broadband-nbn/home-broadband/plans/shop/jcr:content /content/en/for-you/broadband-nbn/home-broadband/internet-speeds/jcr:content

And then changing the path to be compared to /content/en/for-you/broadband-nbn/home-broadband/plans it should show the below comparison: /content/en/for-you/broadband-nbn/home-broadband/plans/jcr:content /content/en/for-you/broadband-nbn/home-broadband/plans/shop/jcr:content

Actual Behavior

While trying to compare the same path in AEM localhost e.g.- /content/en/for-you/broadband-nbn/home-broadband using the JCR compare shows the correct comparison:

/content/en/for-you/broadband-nbn/home-broadband/jcr:content /content/en/for-you/broadband-nbn/home-broadband/moving-home/jcr:content /content/en/for-you/broadband-nbn/home-broadband/plans/jcr:content
/content/en/for-you/broadband-nbn/home-broadband/plans/shop/jcr:content /content/en/for-you/broadband-nbn/home-broadband/internet-speeds/jcr:content

And then changing the path to be compared to /content/en/for-you/broadband-nbn/home-broadband/plans it should show incorrect comparison: /content/en/for-you/broadband-nbn/home-broadband/jcr:content /content/en/for-you/broadband-nbn/home-broadband/moving-home/jcr:content

Steps to Reproduce

  1. Open the http://localhost:4502/etc/acs-commons/jcr-compare.html

  2. Select the path to be compared as: /content/en/for-you/broadband-nbn/home-broadband

  3. Click on 'Content Comparison' tab and select left and right AEM instances as 'localhost'. Click on the compare button.

  4. It shows the correct urls: /content/en/for-you/broadband-nbn/home-broadband/jcr:content /content/en/for-you/broadband-nbn/home-broadband/moving-home/jcr:content /content/en/for-you/broadband-nbn/home-broadband/plans/jcr:content
    /content/en/for-you/broadband-nbn/home-broadband/plans/shop/jcr:content /content/en/for-you/broadband-nbn/home-broadband/internet-speeds/jcr:content

  5. Go to Configuration tab and change the path to: /content/en/for-you/broadband-nbn/home-broadband/plans and click the compare button

  6. It shows incorrect urls: /content/en/for-you/broadband-nbn/home-broadband/jcr:content /content/en/for-you/broadband-nbn/home-broadband/moving-home/jcr:content

  7. Also, if i reload the page and try Step 5 again, it shows the correct urls: /content/en/for-you/broadband-nbn/home-broadband/plans/jcr:content
    /content/en/for-you/broadband-nbn/home-broadband/plans/shop/jcr:content

Also, when checked the response of the http://localhost:4502/bin/acs-commons/jcr-compare.hashes.txt call it is always coming correct, so probably looks like the issue is with /jcr-compare/clientlibs/app.js or /jcr-compare/includes/tab-*.jsp files

Links

I cannot attach the actual content, but the issue must be replicable very easily with the above steps provided. Also, it is replicable with /content/we-retail/ca/en/products/women and /content/we-retail/ca/en/products/women/coats (the OOB we-retail site).

saurabh14nov commented 5 years ago

We managed to resolve this issue by changing the below line of code:

'<tr bindonce ' + 'ng-repeat="entry in diffData track by $index"

by

'<tr bindonce ' + 'ng-repeat="entry in diffData" ' +

Seems like bindonce and track by $index are not working properly together. @justinedelson @davidjgonzalez can you please review this?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.