Skip to content

fix(Sign): submit each envelope file independently with its UUID#7446

Merged
vitormattos merged 17 commits intomainfrom
fix/7344-envelope-multi-file-signing
Apr 7, 2026
Merged

fix(Sign): submit each envelope file independently with its UUID#7446
vitormattos merged 17 commits intomainfrom
fix/7344-envelope-multi-file-signing

Conversation

@vitormattos
Copy link
Copy Markdown
Member

@vitormattos vitormattos commented Apr 7, 2026

Summary

When signing an envelope document with multiple child PDFs, submitSignature was sending all visible elements (from all child files) to a single sign_request_uuid — the first signer's UUID from Array.find(). The backend's validateSignerIsOwnerOfPdfVisibleElement correctly rejected elements from file 2 when called under file 1's sign request → HTTP 422.

Root Cause

signRequestUuid computed calls getSigningRouteUuid(document, fallback) which uses Array.find() and returns only the first me=true signer's UUID. An envelope with 2 child PDFs has two me=true signers, each with a distinct sign_request_uuid.

Fix

Before submitting, collect all me=true signers that have a sign_request_uuid. If the document is an envelope with matched signers, iterate and make one signStore.submitSignature call per file, filtering elements by signRequestId so each call only carries the elements belonging to that specific file.

Non-envelope documents (or envelopes where no matched signers are found) fall through to the unchanged single-file path.

Both the Composition API let submitSignature function and the backward-compat Options API shim in defineOptions.methods are updated.

Tests

Four regression tests added:

  • Per-file calls with visible elements (canCreateSignature=false)
  • Per-file calls with no visible elements (click-to-sign envelope)
  • Single-file documents remain unaffected (non-envelope baseline)
  • Per-file calls with profileNodeId when canCreateSignature=true

Covers issue #7344 phase 2: when an envelope has multiple child files
each with a me=true signer and a distinct sign_request_uuid, the
submitSignature method should call signStore.submitSignature once per
file with only the elements belonging to that file and the correct UUID.

Four cases are covered:
- per-file calls with visible elements (canCreateSignature=false)
- per-file calls with no visible elements (click-to-sign envelope)
- single-file documents remain unaffected (non-envelope baseline)
- per-file calls with profileNodeId when canCreateSignature=true

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
When signing an envelope document that has multiple child PDFs, the
current submitSignature sends every visible element to a single
sign_request_uuid (the first me=true signer's).  The backend rejects
it with HTTP 422 because elements belonging to file 2 are sent under
file 1's sign_request context.

Fix: before submitting, collect all me=true signers that have a
sign_request_uuid.  If the document is an envelope and more than one
signer is found, iterate them and make one signStore.submitSignature
call per signer, filtering elements by signRequestId so each call only
carries the elements that belong to that specific file.

The fallback (no matched envelope signers, or non-envelope documents)
preserves the existing single-file code path unchanged.

Both the Composition API let submitSignature and the backward-compat
Options API shim in defineOptions.methods are updated.

Closes: #7344 (phase 2)
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Apr 7, 2026
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos changed the title fix(Sign): submit each envelope file independently with its UUID (closes #7344 phase 2) fix(Sign): submit each envelope file independently with its UUID Apr 7, 2026
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ents

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable33

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@vitormattos vitormattos merged commit 1112b11 into main Apr 7, 2026
69 checks passed
@vitormattos vitormattos deleted the fix/7344-envelope-multi-file-signing branch April 7, 2026 12:02
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

1 participant