PDF export times out for macro-heavy pages when Forge Custom UI adfExport returns null for PDF

XMLWordPrintable

    • 2
    • Severity 3 - Minor
    • 1
    • Warranty

      Issue Summary

      PDF export fails for Confluence pages containing multiple instances of a Forge Custom UI macro that declares adfExport and returns null when exportType is pdf.
      This has been reproduced independently by two developers using heavy Custom UI macros:

      • Original reproduction: 12 macro instances failed after 245 s; 18 failed after 242 s.
      • Independent reproduction: 12 instances failed at 241 s twice; 18 failed at 254 s.
      • Both cases used an adfExport handler that returns null for PDF, which is the documented fallback for native PDF rendering following CONFCLOUD-83083.

      Steps to Reproduce

      1. Create a Forge Confluence Custom UI macro that declares an adfExport function. Configure the function to return null for PDF exports, for example:
         export const adfExport = async (
        { exportType }
        ) =>
        Unknown macro: {if (exportType === 'pdf') {return null;}// Return applicable ADF for other export types.}
        ;
      2. Render moderately heavy Custom UI content in the macro. 
      3. Create a Confluence page containing multiple copies of the macro. The failure has been reproduced with 12 and 18 instances; the exact threshold can vary with macro content and bundle size.
      4. Use Confluence’s new PDF export dialog to export the page as PDF.

      Expected Results

      The PDF export completes successfully and renders the macros using the native PDF fallback, as intended when adfExport returns null for exportType: 'pdf'.

      Actual Results

      • The export status remains IN_PROGRESS at 0%.
      • After approximately 241–255 seconds, the export fails with:

        Something went wrong – An unexpected error occurred

      • The failure occurs despite successful, fast adfExport handler invocations.
      • The same content behaves differently under controls:
        • Real ADF returned for PDF: 18 macro instances exported in approximately 36 seconds.
        • No adfExport declared: 18 macro instances exported in approximately 23 seconds, with all diagrams rendered.
        • adfExport returns null for PDF: 12–18 instances intermittently timed out after approximately four minutes.

      The export remains in IN_PROGRESS at 0% until the apparent server-side timeout is reached.

      Workaround

      There is no known workaround that preserves the intended native PDF fallback (adfExport returning null for PDF) for macro-heavy pages.

      Potential mitigations with behavior trade-offs are:

      1. Return fully rendered ADF from adfExport for PDF exports instead of null.
      2. Remove the adfExport declaration, if the app can accept the resulting export behavior.

      A workaround will be added here when available.

              Assignee:
              Ying Wang
              Reporter:
              Bernardo A
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: