fix: show the correct error for a single folder attachment - #100706
fix: show the correct error for a single folder attachment#100706chrispader wants to merge 1 commit into
Conversation
|
@MelvinBot create a GH issue for this PR and assign me to it. Update the PR description to link to this issue. |
|
Done — created #100707 and assigned Issue: Single folder attachment shows the generic corrupted-file error instead of the folder-specific error I also updated this PR description:
I searched both |
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Dragging a single folder into the attachment picker currently shows the generic corrupted-file error even though the app identifies it as a folder. The folder-specific message is only selected when the validation state marks the selection as multiple files. This PR uses the folder-specific error for both single- and multi-item selections and adds focused regression coverage.
Explanation of Change
This originated while re-evaluating the unfinished attachment-validation work in #85751. Most of that work was later covered by #86189, which corrected receipt attachment validation, #93234, which made multi-file validation sequential and cleaned up object URLs, and #92236, which expanded
useFilesValidationcoverage. Related fixes in #96024 and #96940 also addressed HEIC conversion failures and file snapshot reliability. Comparing those changes with the current implementation exposed one remaining gap:getFileValidationErrorText()only mappedFOLDER_NOT_ALLOWEDto the folder-specific copy during multi-file validation.This change moves that mapping into the common error switch so the result no longer depends on the number of selected items. Unit tests cover both a single folder and a folder in a multi-item selection.
Fixed Issues
$ #100707
PROPOSAL: N/A
Tests
Offline tests
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Pending manual verification.
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari