Merged
Conversation
…cument methods, skip validation on empty action
Reviewer's GuideThis PR fixes inbox document uploads by preserving and validating the original uploaded file names, hardening incoming document utilities with null/empty checks, and exposing new actions for viewing and displaying incoming documents. Class diagram for updated DocumentUpload2ActionclassDiagram
class DocumentUpload2Action {
- File docFile
- File filedata
+ String filedataFileName
+ String filedataContentType
- String docPublic
- String mode
+ String getFiledataFileName()
+ void setFiledataFileName(String filedataFileName)
+ String getFiledataContentType()
+ void setFiledataContentType(String filedataContentType)
}
Class diagram for updated ManageDocument2Action actionsclassDiagram
class ManageDocument2Action {
+ void viewIncomingDocPageAsPdf()
+ void viewIncomingDocPageAsImage()
+ void displayIncomingDocs()
}
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
2 tasks
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- The silent early return in doPagesAction for empty pdfAction can complicate debugging—consider adding logging or explicit error handling when pdfAction is missing.
- Filename sanitization logic is duplicated in multiple places; centralize the validation/sanitization into a shared utility to ensure consistency and reduce code duplication.
- The new filedataContentType field is never used—either remove it or leverage it to validate uploaded file types and improve upload security.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The silent early return in doPagesAction for empty pdfAction can complicate debugging—consider adding logging or explicit error handling when pdfAction is missing.
- Filename sanitization logic is duplicated in multiple places; centralize the validation/sanitization into a shared utility to ensure consistency and reduce code duplication.
- The new filedataContentType field is never used—either remove it or leverage it to validate uploaded file types and improve upload security.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
yingbull
suggested changes
Sep 30, 2025
src/main/java/ca/openosp/openo/documentManager/actions/DocumentUpload2Action.java
Outdated
Show resolved
Hide resolved
yingbull
approved these changes
Oct 1, 2025
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.
Changes made
DocumentUpload2Action(not the "on disk" file name).IncomingDocUtil.viewIncomingDocPageAsPdf,viewIncomingDocPageAsImage, anddisplayIncomingDocsas actions inManageDocument2Action.Summary by Sourcery
Fix inbox document uploads by preserving original file names, improving filename validation, preventing null page actions, and adding new view actions for incoming documents
New Features:
Bug Fixes:
Enhancements: