External approver page fails when Confluence rate-limits the page attachments
Description
Problem
When an external approver opens their decision page for a Confluence page, Approval Path renders a preview of the page. To do that it read the page's attachment list from Confluence and then made one more Confluence call per attachment to resolve its download link, on every page view.
If any of these calls failed (seen on QA on 2026-11-23 13:04 UTC: GET /api/v2/pages/{id}/attachments answered 429 Too Many Requests), the whole decision page failed with an error, so the external approver could not see the approval or decide. A page with many attachments made dozens of Confluence calls per view, which made the rate limit easy to hit.
Log (QA): ConfluenceException: GET https://api.atlassian.com/ex/confluence/.../api/v2/pages/2597323838/attachments?limit=250 failed with HTTP status code 429 from ConfluenceMediaFetcher.startFetching, handled by CustomExceptionHandler for dashboard.html?id=....
Change
-
If Confluence rate-limits or fails the attachment list, the decision page still opens: the Attachments section says "Attachments could not be loaded right now." and images in the page content show "Attachment unavailable". A warning is logged instead of an error.
-
The other optional parts of the preview (breadcrumbs, owner, labels, last comments) degrade the same way: a part that fails to load shows "Could not be loaded right now." under its heading, so it is not mistaken for a part with no data ("—"). If the page itself, its title or content, or the participant names cannot be loaded, the error page is still shown as before.
-
Attachment and image links point to Approval Path (
/dashboard/attachment). The Confluence download link is resolved only when the file is loaded or opened, after the same access check as the decision page: the approver is logged in, the approval is still open to them, and the attachment belongs to the approval's page. -
A page view makes one Confluence call for the attachment list, shared by approvers viewing the page at the same moment. The list is reused for up to 5 minutes and refreshed when the page changes or one of its attachments is added, changed, trashed, restored or deleted (Approval Path for Confluence now listens to Confluence attachment events). Each image or file costs one Confluence lookup when it is loaded or opened, reused for about a minute per attachment version.
Decisions
-
Access to an attachment link is checked against the approver's session and approval, like the decision page. An attachment outside the approval's page, or a malformed link, shows the Approval Path error page saying the attachment is not available.
-
If Confluence is busy (rate limit or server error) when a file is opened, the approver sees the Approval Path error page asking to try again in a moment. Other Confluence refusals are errors, as before.
-
The page title and content stay required: an approver should not decide on an empty preview.
-
Jira work items: the preview still resolves download and thumbnail links per attachment and per image in the description while rendering. A failing Attachments section no longer breaks the page, but a rate-limited image lookup in the description still does. Not changed in this ticket; worth the same lazy-link approach later.
Fixes included
-
A failure in any optional preview part (breadcrumbs, owner, labels, last comments, attachments) no longer fails the whole decision page, in Jira and Confluence; the part says it could not be loaded.
Manual tester notes
-
In Confluence, start an approval with an external email approver on a page with an image in the content and a PDF and an image as attachments. Open the approval from the email as the approver: the image in the content and the attachments show; clicking the PDF downloads it; clicking the image opens it.
-
With the decision page open, add another attachment to the Confluence page (without editing the page) and reload the decision page after a few seconds: the new attachment is listed.
-
Copy an attachment link from the decision page and open it in a private window: you are asked to log in and then land on the approval.
-
Change the end of an attachment link (for example add
xto the attachment id) and open it as the approver: the Approval Path error page says the attachment is not available.
Before release
-
The Approval Path for Confluence Forge deploy adds triggers for Confluence attachment events (no new scope, no admin consent needed). After deploy, check that adding an attachment to a page under approval shows it on the decision page within a few seconds.
-
Check prod logs after deploy: no more
CustomExceptionHandlererrors fordashboard.html?id=caused by a 429 on/attachments; warningsPreview of page ... is shown without attachmentsmay appear instead.