Skip to content

[Confluence]: PDF export function no longer working #1158 BUGFIX #1161

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

Merged
merged 4 commits into from
May 13, 2023

Conversation

rosomri
Copy link
Contributor

@rosomri rosomri commented May 4, 2023

#1158 bugix

TLDR;
Atlassian recently updated Confluence's PDF export functionality.

Here's the current flow works:

  1. Create a pdf page export task using the spaces/flyingpdf/pdfpageexport.action?pageId={pageId} endpoint.
  2. In the next step, use the poll endpoint, runningtaskxml.action?taskId={taskId}, to determine whether the export task has been completed.
  3. Retrieve the download URL from the poll endpoint response if the task was successfully completed
  4. Get the PDF data from the retrieved endpoint.

Step 2 seems to be where the issue appears:

  • It does not matter if the task is successfully initialised or not, the poll endpoint will report that the task does not exist without raising an error message.
  • As a result, step 3 queries the space URL without a specific page.
  • Consequently, the response is a general HTML page without any error messages.

The problems are as follows:

  • There seems to be a problem with the poll endpoint. Atlassian recently updated Confluence's PDF export functionality.
  • An error should be thrown if the task ID is invalid.

PR main changes
The functionality is working as expected

  • Atlassian recently updated Confluence's PDF export functionality. To get the export task's current state, task/{taskId}/progress endpoint should be used instead of the deprecated runningtaskxml.action?taskId={taskId}.
  • Also the flow of retrieving the content from the download signed URL was changed a bit.
    In order to download a PDF file from a signed S3 URL, you do not need to provide any authentication or headers. If you do provide those, the request will fail. As the session has already been initiated with those headers, it cannot be used. Does it make sense to use the request library directly?
  • Feel free to edit and elaborate

@cforce
Copy link

cforce commented May 11, 2023

Please merge. It blocks usage of the Confluence apis:
I try to use it based on direct import but still struggle - see operatorequals/httpimport#53

@gonchik gonchik merged commit c8eaea9 into atlassian-api:master May 13, 2023
@cforce
Copy link

cforce commented May 14, 2023

Please release

@cforce
Copy link

cforce commented May 16, 2023

This bugfix is still not released -what is preventing it?

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

Successfully merging this pull request may close these issues.

3 participants