[stable31] fix: envelope single folder#6275
Merged
vitormattos merged 7 commits intostable31from Dec 30, 2025
Merged
Conversation
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Vitor Mattos <[email protected]>
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 <[email protected]>
Signed-off-by: Vitor Mattos <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of PR #6274