Skip to content

fix(validation): base the validation summary on applied signatures only - #9009

Merged
vitormattos merged 2 commits into
LibreSign:mainfrom
maia-andre:fix/validation-summary-unsigned-8967
Oct 21, 2026
Merged

vitormattos merged 2 commits into
LibreSign:mainfrom
maia-andre:fix/validation-summary-unsigned-8967

Conversation

@maia-andre

Copy link
Copy Markdown
Contributor

Resolves: #8967

📝 Summary

The validation page showed "This document is valid" for a document nobody has signed yet, and for an envelope where nobody signed.

getDocumentValidationSummary() in src/views/Validation.vue only returned "No digital signatures were found in this document" when the signer list was empty. A pending signer carries no signature_validation, modification_validation or document_modification_state, so none of the error or warning checks matched and the summary fell through to "valid".

The summary now considers only the signers who have signed, meaning a signer with a signing date or with signature validation data:

  • nobody has signed → the existing "No digital signatures were found in this document" (info) note, whatever the number of signers;
  • at least one signature → the current checks, run on the signed signers only.

The same function feeds the header note for single files and envelopes, so both are covered. No new strings.

🧪 How to test

  1. Request a signature on any PDF from one signer.
  2. Before anybody signs, open /apps/libresign/p/validation/<uuid> (logged out is fine).
  3. The note reads No digital signatures were found in this document. Before this fix it read "This document is valid".
  4. Repeat with an envelope of two files: the same note appears.
  5. Sign the document and reopen the validation page: it reads This document is valid as before.

🎨 UI changes

  • Validation summary note computed from applied signatures only
  • Screenshots before/after
🏚️ Before 🏡 After
Unsigned document, before Unsigned document, after
Envelope nobody signed, before Envelope nobody signed, after

Signed document, unchanged:

Signed document still valid

  • Components, Unit (with vitest) and/or e2e (with Playwright) tests added - Required

Vitest cases in src/tests/views/Validation.spec.ts: nobody signed, envelope where nobody signed, only signed signers are evaluated, and a signer with a signing date but no cryptographic details. Local runs: npx vitest run src/tests/views/Validation.spec.ts src/tests/views/DocumentValidationLogic.spec.ts (116 passed), npm run ts:check, eslint on the changed files.

Backport

The same logic is on stable33, stable34 and stable35, and the commit cherry-picks cleanly onto them. stable32 has older code that sets "This document is valid" unconditionally, so this change does not apply there as is.

✅ Checklist

🤖 AI (if applicable)

  • The content of this PR was partially or fully generated using AI

@maia-andre
maia-andre requested a review from a team as a code owner October 4, 2026 17:41
@YvesCesar
YvesCesar self-requested a review October 17, 2026 17:06

@YvesCesar YvesCesar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@maia-andre

Can you check this review?

Comment thread src/views/Validation.vue Outdated
Comment thread src/views/Validation.vue Outdated
@maia-andre
maia-andre requested a review from YvesCesar October 17, 2026 21:55

@YvesCesar YvesCesar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Many thanks, @maia-andre !

@vitormattos looks okay to me.
I don't think the errors in the pipelines are related to the PR.

The validation page showed "This document is valid" for a document that
nobody has signed yet, and for an envelope where nobody signed. The
summary only returned "No digital signatures were found in this
document" when the signer list was empty; a pending signer carries no
signature data, so none of the error or warning checks matched and the
summary fell through to "valid".

The summary now considers only the signers who have signed (a signing
date or signature validation data). When nobody has signed, it shows
the existing "No digital signatures were found" note; otherwise the
current checks run on the signed signers only.

Fixes LibreSign#8967

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: André Maia <andrefnkmm@gmail.com>
…e summary

Signed-off-by: André Maia <andrefnkmm@gmail.com>
@vitormattos
vitormattos force-pushed the fix/validation-summary-unsigned-8967 branch from d02d24b to 24d5a9c Compare October 21, 2026 01:09
@vitormattos

Copy link
Copy Markdown
Member

/backport to stable35

@vitormattos

Copy link
Copy Markdown
Member

/backport to stable34

@backportbot-libresign backportbot-libresign Bot added the backport-request Request to backport a change to supported stable branches label Oct 21, 2026
@vitormattos

Copy link
Copy Markdown
Member

/backport to stable33

@vitormattos vitormattos added this to the Next Major (36) milestone Oct 21, 2026
@vitormattos
vitormattos merged commit 2764b33 into LibreSign:main Oct 21, 2026
63 checks passed
@backportbot-libresign backportbot-libresign Bot removed the backport-request Request to backport a change to supported stable branches label Oct 21, 2026
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.

Validation page says "This document is valid" for a document with no signature

3 participants