From abe1339abc44cc10c18b983fdafafa9ea45e3824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maia?= Date: Sun, 4 Oct 2026 14:35:08 -0300 Subject: [PATCH 1/2] fix(validation): base the validation summary on applied signatures only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #8967 Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: André Maia --- src/tests/views/Validation.spec.ts | 53 ++++++++++++++++++++++++++++++ src/views/Validation.vue | 7 +++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/src/tests/views/Validation.spec.ts b/src/tests/views/Validation.spec.ts index 352c1f73a1..95ef96e808 100644 --- a/src/tests/views/Validation.spec.ts +++ b/src/tests/views/Validation.spec.ts @@ -352,6 +352,59 @@ describe('Validation.vue - Business Logic', () => { }) }) + it('shows info when nobody has signed yet', () => { + expect(wrapper.vm.getDocumentValidationSummary({ + signers: [ + { signed: null }, + { signed: null }, + ], + files: [], + })).toEqual({ + message: 'No digital signatures were found in this document', + type: 'info', + }) + }) + + it('shows info for an envelope where nobody has signed', () => { + expect(wrapper.vm.getDocumentValidationSummary({ + signers: [{ signed: null }], + files: [ + { signers: [{ signed: null }] }, + { signers: [{ signed: null }] }, + ], + })).toEqual({ + message: 'No digital signatures were found in this document', + type: 'info', + }) + }) + + it('evaluates only the signers who have signed', () => { + expect(wrapper.vm.getDocumentValidationSummary({ + signers: [ + { + signed: '2026-10-01T12:00:00+00:00', + signature_validation: { id: 1 }, + document_modification_state: 'unchanged', + }, + { signed: null, modifications: { modified: true } }, + ], + files: [], + })).toEqual({ + message: 'This document is valid', + type: 'success', + }) + }) + + it('treats a signer with a signing date as signed even without cryptographic details', () => { + expect(wrapper.vm.getDocumentValidationSummary({ + signers: [{ signed: '2026-10-01T12:00:00+00:00' }], + files: [], + })).toEqual({ + message: 'This document is valid', + type: 'success', + }) + }) + it('shows warning when the document was modified after signing', () => { expect(wrapper.vm.getDocumentValidationSummary({ signers: [{ diff --git a/src/views/Validation.vue b/src/views/Validation.vue index b95bcc989d..ab9811d105 100644 --- a/src/views/Validation.vue +++ b/src/views/Validation.vue @@ -796,8 +796,13 @@ function getValidationDocumentSigners(validationDocument: ValidationDocumentStat return signers } +function hasAppliedSignature(signer: ValidationDisplaySigner) { + return Boolean(signer.signed) || signer.signature_validation !== undefined +} + function getDocumentValidationSummary(validationDocument: ValidationDocumentState): DocumentValidationSummary { - const signers = getValidationDocumentSigners(validationDocument) + // Pending signers carry no signature data, so they must not count towards a "valid" verdict + const signers = getValidationDocumentSigners(validationDocument).filter(hasAppliedSignature) if (signers.length === 0) { return { From 24d5a9c37e78fc1a56b0785d875dfaeb959eb604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maia?= Date: Sat, 17 Oct 2026 18:46:59 -0300 Subject: [PATCH 2/2] fix(validation): count signers with the signed status as signed in the summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Maia --- src/tests/views/Validation.spec.ts | 10 ++++++++++ src/views/Validation.vue | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/tests/views/Validation.spec.ts b/src/tests/views/Validation.spec.ts index 95ef96e808..c55e2e019d 100644 --- a/src/tests/views/Validation.spec.ts +++ b/src/tests/views/Validation.spec.ts @@ -405,6 +405,16 @@ describe('Validation.vue - Business Logic', () => { }) }) + it('treats a signer with the signed status as signed even without a signing date', () => { + expect(wrapper.vm.getDocumentValidationSummary({ + signers: [{ status: 2 }], + files: [], + })).toEqual({ + message: 'This document is valid', + type: 'success', + }) + }) + it('shows warning when the document was modified after signing', () => { expect(wrapper.vm.getDocumentValidationSummary({ signers: [{ diff --git a/src/views/Validation.vue b/src/views/Validation.vue index ab9811d105..d5699e5a0a 100644 --- a/src/views/Validation.vue +++ b/src/views/Validation.vue @@ -797,11 +797,12 @@ function getValidationDocumentSigners(validationDocument: ValidationDocumentStat } function hasAppliedSignature(signer: ValidationDisplaySigner) { - return Boolean(signer.signed) || signer.signature_validation !== undefined + return Boolean(signer.signed) + || Number(signer.status) === SIGN_REQUEST_STATUS.SIGNED + || signer.signature_validation !== undefined } function getDocumentValidationSummary(validationDocument: ValidationDocumentState): DocumentValidationSummary { - // Pending signers carry no signature data, so they must not count towards a "valid" verdict const signers = getValidationDocumentSigners(validationDocument).filter(hasAppliedSignature) if (signers.length === 0) {