Prevent Excel tag files from being uploaded (PR by ijmalik)#79186
Prevent Excel tag files from being uploaded (PR by ijmalik)#79186yuwenmemon merged 12 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Hi @Pujan92, Kindly review this PR when you have a moment. Thank you. CC: @yuwenmemon |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
src/components/ImportSpreadsheet.tsx
Outdated
| if (!CONST.MULTILEVEL_TAG_ALLOWED_SPREADSHEET_EXTENSIONS.includes(lowerExt as TupleToUnion<typeof CONST.MULTILEVEL_TAG_ALLOWED_SPREADSHEET_EXTENSIONS>)) { | ||
| setUploadFileError(true, 'attachmentPicker.wrongFileType', 'attachmentPicker.notAllowedExtension'); | ||
| return false; | ||
| } | ||
| } else if (!allowedExtensions.includes(fileExtension.toLowerCase())) { | ||
| setUploadFileError(true, 'attachmentPicker.wrongFileType', 'attachmentPicker.notAllowedExtension'); | ||
| return false; | ||
| } |
There was a problem hiding this comment.
| if (!CONST.MULTILEVEL_TAG_ALLOWED_SPREADSHEET_EXTENSIONS.includes(lowerExt as TupleToUnion<typeof CONST.MULTILEVEL_TAG_ALLOWED_SPREADSHEET_EXTENSIONS>)) { | |
| setUploadFileError(true, 'attachmentPicker.wrongFileType', 'attachmentPicker.notAllowedExtension'); | |
| return false; | |
| } | |
| } else if (!allowedExtensions.includes(fileExtension.toLowerCase())) { | |
| setUploadFileError(true, 'attachmentPicker.wrongFileType', 'attachmentPicker.notAllowedExtension'); | |
| return false; | |
| } | |
| if (!allowedExtensions.includes(fileExtension.toLowerCase())) { | |
| setUploadFileError(true, 'attachmentPicker.wrongFileType', 'attachmentPicker.notAllowedExtension'); | |
| return false; | |
| } |
We don't require 2 conditions now as we are conditionally assigning the data to allowedExtensions.
Pujan92
left a comment
There was a problem hiding this comment.
LGTM!
Screen.Recording.2026-01-10.at.22.34.00.mov
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.3.0-0 🚀
|
|
I’ve tested the changes on staging, it is working as expected. issue.78415.staging.working.mp4 |
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.3.0-8 🚀
|
|
I’ve tested the changes on production, it is working as expected. issue.78415.production.working.mp4
|

Explanation of Change
This change prevents Excel-based files (.xls and .xlsx) from being uploaded during tag imports.
Previously, the client allowed these files to be selected and submitted, resulting in an error after upload.
The update prevents users from submitting unsupported Excel files.
Fixed Issues
$ #78415
PROPOSAL: #78415 (comment)
Tests
Offline tests
Same as tests
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
issue.78415.android.app.mp4
Android: mWeb Chrome
issue.78415.android.mweb.mp4
iOS: Native
issue.78415.ios.app.mp4
iOS: mWeb Safari
issue.78415.ios.safari.mp4
MacOS: Chrome / Safari
issue.78415.mac.web.mp4