-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CMM-927 suppor attachments limit #22338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
…/github.com/wordpress-mobile/WordPress-Android into feat/CMM-843-Create-the-Ask-the-HE-entry-UI
# Conflicts: # WordPress/src/main/java/org/wordpress/android/support/he/ui/HESupportViewModel.kt # WordPress/src/test/java/org/wordpress/android/support/he/ui/HESupportViewModelTest.kt
Generated by 🚫 Danger |
|
Claude finished @adalpari's task —— View job Code Review for PR #22338: CMM-927 Support Limit AttachmentsI've completed a comprehensive code review of your attachment size validation feature. Overall, the implementation is solid with good test coverage and nice UX design. However, I've identified several issues that should be addressed before merging. SummaryStrengths:
Issues Found:
Detailed Findings1. Critical Issue: Silent Rejection of Files with Unknown SizeLocation: When Impact: Poor user experience - files vanish silently Recommendation: Add a third rejection reason: sealed class RejectionReason {
data object FileTooLarge : RejectionReason()
data object TotalSizeExceeded : RejectionReason()
data object UnknownSize : RejectionReason() // For files where size cannot be determined
}2. Logic Issue: Multiple Rejection Types Not HandledLocation: If some files are individually too large AND other files exceed the total size, only the last rejection type is shown to the user. Recommendation: Track which rejection scenario to prioritize or show a combined message. 3. Boundary Condition: Individual File Size CheckLocation: The check Recommendation:
4. Security: Exception SwallowingLocation: Exceptions when determining file size are silently swallowed. This could mask permission issues or security problems. Recommendation: Add debug logging: } catch (e: Exception) {
appLogWrapper.d(AppLog.T.SUPPORT, "Could not determine file size for URI: $uri - ${e.message}")
null
}5. Test Coverage GapsLocation: Missing tests for:
Code Quality AssessmentArchitecture: ✅ Good
Error Handling:
Testing: ✅ Good (with gaps)
Performance: ✅ Good
Security: ✅ Adequate
Additional ObservationsStrings.xml WarningThe danger bot correctly flagged that
UX PolishThe visual design is excellent! The rejected files section with thumbnails and error overlay is very intuitive. Minor enhancement suggestion: show the count of skipped files in the header. DocumentationConsider adding KDoc comments to the validation methods explaining:
Recommendations PriorityMust Fix Before Merge:
Should Fix: Nice to Have: Testing Instructions VerificationI reviewed the screenshots and the implementation matches the testing instructions:
ConclusionThis is a well-implemented feature with good attention to UX details. The main issues are around edge case handling and user feedback completeness. Once the critical issue with null file sizes is addressed, this will be ready to merge. Great work on the comprehensive test coverage and the intuitive visual design for showing rejected files! 🎉 |
WordPress/src/main/java/org/wordpress/android/support/he/ui/HESupportViewModel.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/support/he/ui/HESupportViewModel.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/support/he/ui/HESupportViewModel.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/support/he/ui/HESupportViewModel.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/support/he/ui/TicketMainContentView.kt
Show resolved
Hide resolved
WordPress/src/test/java/org/wordpress/android/support/he/ui/HESupportViewModelTest.kt
Show resolved
Hide resolved
WordPress/src/test/java/org/wordpress/android/support/he/ui/HESupportViewModelTest.kt
Show resolved
Hide resolved
|
Claude finished @adalpari's task —— View job Code Review Complete ✓I've reviewed the current state of the PR and compared it against the previous review feedback. Here's my comprehensive analysis: ✅ Issues Successfully Addressed1. Null File Size Handling (WordPress/src/main/java/org/wordpress/android/support/he/ui/HESupportViewModel.kt:202-217)The code now properly handles files with unknown sizes by allowing them through (fail-open approach). This is a reasonable design decision:
Status: ✅ Resolved 2. Individual File Size Check Fixed (WordPress/src/main/java/org/wordpress/android/support/he/ui/HESupportViewModel.kt:205)Changed from if (fileSize > MAX_TOTAL_SIZE_BYTES) { // Now accepts exactly 20MBTest coverage confirms this: Status: ✅ Resolved 3. Excellent Test CoverageThe test suite is comprehensive with edge cases covered:
Status: ✅ Excellent
|
Major issues fixed (see the second Claude iteration) |
|
| App Name | Jetpack | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22338-1a67f93 | |
| Commit | 1a67f93 | |
| Direct Download | jetpack-prototype-build-pr22338-1a67f93.apk |
|
|
| App Name | WordPress | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22338-1a67f93 | |
| Commit | 1a67f93 | |
| Direct Download | wordpress-prototype-build-pr22338-1a67f93.apk |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22338 +/- ##
==========================================
- Coverage 39.21% 39.20% -0.01%
==========================================
Files 2201 2203 +2
Lines 105788 105926 +138
Branches 15009 15024 +15
==========================================
+ Hits 41485 41529 +44
- Misses 60811 60904 +93
- Partials 3492 3493 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|





Description
This PR checks the attachments size before sending them to the server, and shows proper errors if the user reaches the limit.
Testing instructions
MODERN_SUPPORTFF