Skip to content

fix(validation): open signed PDF by UUID instead of the owner's nodeIdFixes #9103 - #9104

Open
oPeras1 wants to merge 1 commit into
LibreSign:mainfrom
oPeras1:fix/validation-open-signed-pdf
Open

oPeras1 wants to merge 1 commit into
LibreSign:mainfrom
oPeras1:fix/validation-open-signed-pdf

Conversation

@oPeras1

@oPeras1 oPeras1 commented Oct 17, 2026 •

Copy link
Copy Markdown

Resolves: #9103

📝 Summary

On the validation page, "Open file" / "View PDF" passed the file owner's original nodeId to OCA.Viewer for logged-in users. Viewer handlers that resolve fileid in the current user's filesystem (Euro-Office, ONLYOFFICE) then:

  • showed the owner the unsigned original instead of the signed PDF;
  • failed with {"error":"File not found"} for signers and other logged-in users.

This PR makes the validation page always open the signed PDF by UUID (/apps/libresign/p/pdf/<uuid>), as it already does for anonymous visitors. openDocument now only uses OCA.Viewer when a nodeId is explicitly given, so other callers (Files list, sidebar, ID docs, settings) are unchanged.

The change is frontend only. The backend route already resolves the storage owner from the UUID and serves the signed file.

🧪 How to test

  1. Install Euro-Office (or ONLYOFFICE) and enable PDF as a default format in its admin settings.
  2. As user X, request signatures from Nextcloud users Y and Z without sharing the file. Have both sign.
  3. Open /apps/libresign/validation/<uuid> and click "Open file":
    • as X: the signed PDF opens (before: unsigned original);
    • as Y, and as an unrelated logged-in user W: the signed PDF opens (before: "File not found");
    • logged out: the signed PDF still opens.
  4. Optional: repeat with PDF not set as a Euro-Office default. Behaviour is the same.
  5. Optional: for an envelope, check that "View PDF" on each file opens that file's signed PDF.

Validation evidence

  • Focused regression/acceptance test
  • Relevant lint/type/static-analysis checks
  • Broader suite required by the changed surface
  • CI reviewed

🎨 UI / Front-end changes

  • The validation page opens the signed PDF by UUID for every visitor.
  • Logged-in users now get the PDF in a new tab instead of the Viewer overlay, as anonymous users already do on main. The Viewer picks its handler by MIME type, and some handlers need a node the user can access, so it can't be used safely here.
  • In EnvelopeValidation, "View PDF" is shown when a file has a uuid, instead of requiring nodeId.

🚧 Tasks

  • Manual check with Euro-Office as the default PDF viewer (owner, signer, unrelated user, anonymous)

✅ Checklist

  • I have read and followed the contribution guide.
  • The diff does not contain unrelated refactors or generated changes.
  • Commits follow Conventional Commits where applicable.
  • All commits include the required DCO sign-off.

🤖 AI (if applicable)

  • Only the tests suite was generated using AI;

@oPeras1
oPeras1 requested a review from a team as a code owner October 17, 2026 19:01
Copilot AI balanced review requested due to automatic review settings October 17, 2026 19:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Signed-off-by: oPeras1 <hugo.pereira@rnl.tecnico.ulisboa.pt>
@oPeras1
oPeras1 force-pushed the fix/validation-open-signed-pdf branch from 25f1d8c to 73d761e Compare October 17, 2026 20:34

This branch has not been deployed

No deployments
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.

"Open file" on the validation page fails when Euro-Office/ONLYOFFICE is the default PDF viewer

2 participants