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

PDF Viewer not loading on page refresh #1180

Closed
RahulMohann opened this issue Sep 18, 2024 · 5 comments · Fixed by #1181
Closed

PDF Viewer not loading on page refresh #1180

RahulMohann opened this issue Sep 18, 2024 · 5 comments · Fixed by #1181
Labels
Milestone

Comments

@RahulMohann
Copy link

RahulMohann commented Sep 18, 2024

Describe the bug
We are using the PDF viewer component in our detail page to render pdf and other documents. We are observing the below behavior.

  1. Login to the ASC and then open a pdf from the search page. It (detail page) loads for the first time and PDF is getting rendered in the pdf viewer component.
  2. Refresh the same detail page once and the PDF viewer doesn't load.
  3. Go back to search page and open another PDF, still the pdf viewer doesn't load.
  4. Clear the browser cache and do refresh the detail page and the PDF viewer loads and render the document.

Any idea why this is happening and how to fix?

Environment

  • AEM Version: 2024.8.17465.20240813T175259Z
  • Asset Share Commons Version: 3.8.12
  • Author, Publish or both: Publish

Thanks,
Rahul

@RahulMohann
Copy link
Author

Hi @davidjgonzalez , Could you please check?

@davidjgonzalez
Copy link
Contributor

@RahulMohann im away until October.

Can you check to see if there are JS errors? Do you see the PDF download HTTP request taking place and completing in the Network panel?

I assume this is a problem with the PDF JS SDK since that is all clientside; all ASC does is popular the HTML/script tag w/ the configured values.

@RahulMohann
Copy link
Author

Hi @davidjgonzalez, I see the document download request always happens successfully. But there is an iframe that doesn't get loaded when you refresh. Attached is the screenshot. If it's a client-side issue, how can we fix it?

Thanks,
Rahul

@RahulMohann
Copy link
Author

Iframe

@davidjgonzalez
Copy link
Contributor

Hi @RahulMohann - Ah, i see it. Its a race condition -- the viewer.js has to be included before the event listener is registered. I'll cut a fix today.

@davidjgonzalez davidjgonzalez mentioned this issue Oct 1, 2024
10 tasks
@davidjgonzalez davidjgonzalez added this to the 3.8.18 milestone Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants