Skip to content

fix: envelope single folder#6274

Merged
vitormattos merged 7 commits intomainfrom
fix/envelope-single-folder
Dec 30, 2025
Merged

fix: envelope single folder#6274
vitormattos merged 7 commits intomainfrom
fix/envelope-single-folder

Conversation

@vitormattos
Copy link
Copy Markdown
Member

@vitormattos vitormattos commented Dec 30, 2025

No description provided.

Previously, two different UUIDs were being generated: one for the
folder name and another for the envelope entity. This caused
inconsistency and made it difficult to correlate folders with
their corresponding envelope records.

Now a single UUID is generated and used for both the envelope
entity and as part of the folder name (Name_UUID format),
ensuring consistency and traceability.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
The logic for determining which folder to use when creating files
was duplicated across FileService, UploadProcessor, and
RequestSignatureService. This created maintenance issues and
increased the risk of inconsistent behavior.

Changes:
- Add getFolderForFile() method to FolderService that centralizes
  folder selection logic
- When envelopeFolderId is provided in settings, use the existing
  envelope folder instead of creating a new one
- Remove duplicated folder creation logic from FileService and
  UploadProcessor
- Update RequestSignatureService to pass envelopeFolderId instead
  of folderName

This ensures only one folder is created per envelope, eliminating
the issue of duplicate folders with different naming patterns.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
The API documentation referenced FolderService::getFolderName as
an implementation detail, which should not be exposed to API
consumers. Changed to a generic description of the settings
parameter functionality.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add unit tests focused on validating business rules:
- Envelope folder name must include user-defined name and UUID
- getFolderForFile() must use existing envelope folder when
  envelopeFolderId is provided
- getFolderForFile() must create new folder when no envelope
  context exists

Tests focus on behavior validation rather than implementation
details, using minimal mocking.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos added this to the Next Major (33) milestone Dec 30, 2025
@vitormattos vitormattos self-assigned this Dec 30, 2025
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Dec 30, 2025
Psalm static analysis reported that getFirstNodeById() can return
null, but getFolderForFile() was not handling this case. Added
explicit null check along with instance check to ensure type
safety and prevent potential null pointer errors.

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 stable32

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable31

@vitormattos vitormattos merged commit 1098b44 into main Dec 30, 2025
67 checks passed
@vitormattos vitormattos deleted the fix/envelope-single-folder branch December 30, 2025 20:12
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant