Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset Download Count Inconsistency Issue #1212

Open
Pawan070707 opened this issue Dec 20, 2024 · 1 comment
Open

Asset Download Count Inconsistency Issue #1212

Pawan070707 opened this issue Dec 20, 2024 · 1 comment
Labels

Comments

@Pawan070707
Copy link

Hi Team,

We are facing intermittent download issues with the Asset Share Commons built site.
On click the download the download icon updates the download count and adds the downloaded assets in the modal.
The issue we are facing is on click of download asset, the count sometimes updates fine, but sometimes it updates to 0 and after which it does not update further.

This issue is only observed in Stage and Prod, whereas in Dev we have never faced this issue.
Same code is deployed in both the environments but still we are seeing a difference in functionality.

The only difference between Stage/Prod and Dev is that the Stage/Prod have multiple pod setup in Publisher, which Dev has default pods.

Have anyone faced similar kind of issue, Please share your insights.

Stage and Prod Only (Works fine in Dev)
AEM Caas
3.8.12
Publish

@davidjgonzalez
Copy link
Contributor

@Pawan070707 The way the count is updated via a XHR/AJAX call to the downloads action modal on page load.

the JS looks at the data-* attribute data-asset-share-downloads-count and displays that value. [1]

Can you check to make sure these calls are being made on page load -- look for XHR calls to your Downloads modal page on page load, and look at the response to see if the HTML is not malformed, and that the element with data-asset-share-downloads-count shows the correct count.

Its also worth noting that the download IDs for your user's downloads are stored in browser's localstorage (look for the asset-share-commons key in local storage). When the call is made to the action modal, the download IDs are sent along w the HTTP request - as the download modal HTML will only count downloads in AEM that match one of these IDs (so it doesnt show you counts for other users) -- so, if that local storage is getting cleared, then the downloads will return zero since the system doesnt think your specific user/browser has any downloads (and any downloads in AEM must belong to other users).

Let me know how it goes!

[1] https://github.com/adobe/asset-share-commons/blob/develop/ui.apps/src/main/content/jcr_root/apps/asset-share-commons/components/modals/downloads/clientlibs/site/js/downloads.js#L54
[2] https://github.com/adobe/asset-share-commons/blob/develop/core.cloud/src/main/java/com/adobe/aem/commons/assetshare/components/actions/downloads/impl/DownloadsImpl.java#L67-L111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants