-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CMM-927 support 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
Conversation
…/github.com/wordpress-mobile/WordPress-Android into feat/CMM-843-Create-the-Ask-the-HE-entry-UI
|
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-cba99f9 | |
| Commit | cba99f9 | |
| Direct Download | jetpack-prototype-build-pr22338-cba99f9.apk |
|
| App Name | WordPress | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22338-cba99f9 | |
| Commit | cba99f9 | |
| Direct Download | wordpress-prototype-build-pr22338-cba99f9.apk |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22338 +/- ##
==========================================
- Coverage 39.16% 39.12% -0.04%
==========================================
Files 2203 2205 +2
Lines 105962 106157 +195
Branches 15027 15049 +22
==========================================
+ Hits 41498 41536 +38
- Misses 60973 61129 +156
- Partials 3491 3492 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I've changed a bit the flow to include the progressbar iOS used. And now, every time the user removes a selected file, we try to re-add the skipped ones because of the total size. Screen_recording_20251106_165557.mp4 |
jkmassel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and it worked as described.
# Conflicts: # WordPress/src/main/java/org/wordpress/android/support/he/ui/HEConversationDetailScreen.kt # WordPress/src/main/java/org/wordpress/android/support/he/ui/HEConversationReplyBottomSheet.kt
|





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