Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-24808

The Live Data is not always rendered in the PDF export

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 18.8.0-rc-1
    • 18.7.0
    • Live Data
    • None
    • Unknown

    Description

      Create a new page with a Live Data macro call. I used the first example from https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HUsage . Export the page to PDF.

      {{liveData
        id="recentPages"
        properties="doc.title,doc.location,doc.author,doc.date"
        source="liveTable"
        sourceParameters="translationPrefix=platform.index."
        sort="doc.date:desc"
        limit="5"
      /}}
      

      Expected: the live data is rendered in the generated PDF, as it was in view mode
      Actual: when performing the export with the user's own browser, the live data is rendered most of the time but once in 5-10 repetitions we see just the spinning wheel. When using the headless Chrome Docker container, the live data is almost never rendered. We just see the loading animation.

      This smells very much like a race condition. The print preview page is printed to PDF once it's ready (window is loaded, all resources / images are loaded, initial async requests have complete). We know it's ready based on the PageReady module, which does some automatic checks (e.g. by hacking into XMLHttpRequet and fetch), but not every "page load delay" case can be detected automatically. In some case we need to manually delay the page ready.

      My feeling that in this case, for live data, we need to manually delay the page ready until the live data fully loaded and rendered (its data is fetched and displayed).

      Attachments

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: