[stable32] fix: store identification documents of external signers under the file owner - #8369
Merged
Conversation
…e owner When an unauthenticated signer uploads an identification document, IdDocsService::addFilesToDocumentFolder() called saveFile() without a userManager. FolderService then had no user id, so the node was written to the unauthenticated appdata folder, while the File row received the owner of the signed file as user_id — the value getPdfByUuid() later uses to look the node up. The document was intact on disk but unreachable from the validation UI (empty viewer, 404 on download). Resolve the owner of the signed file with the same lookup saveFile() already uses for user_id and pass it as userManager, mirroring addIdDocs(). Uploads for a sign request whose owner cannot be resolved keep the current behaviour. Resolves: #8364 Assisted-by: Claude Code:claude-opus-5 Signed-off-by: André Maia <andrefnkmm@gmail.com>
…cs storage getOwnerOfSignedFile() caught \Throwable, which turned unexpected database or programming errors into the unauthenticated appdata fallback — the same inconsistent state this change is fixing. Catch only the DoesNotExistException documented by FileMapper::getById() and let other failures surface. Add one test for the missing row (falls back, no userManager) and one asserting that an unexpected exception is propagated before saveFile() is reached. Assisted-by: Claude Code:claude-opus-5 Signed-off-by: André Maia <andrefnkmm@gmail.com>
vitormattos
approved these changes
Sep 12, 2026
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 #8368