fix: Android - Scan receipt- Unable to download a receipt in the confirmation page#75040
Conversation
|
@mananjadhav 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@TaduJR I don't see any screenshots attached in the PR but marked checked. Can you please fix it? |
Sorry @mananjadhav forgot it after compressing it. Added demo for Android Native |
trjExpensify
left a comment
There was a problem hiding this comment.
Makes sense, definitely want receipts to be downloadable. 👍
…-download-a-receipt-in-the-confirmation-page
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid-scan-receipt-with-spaces.movAndroid: mWeb ChromeNA iOS: HybridAppNA iOS: mWeb SafariNA MacOS: Chrome / SafariNA MacOS: DesktopNA |
|
✋ 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/blimpich in version: 9.2.60-0 🚀
|
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.2.60-0 🚀
|
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.2.60-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.2.60-2 🚀
|
Explanation of Change
This PR fixes an issue where downloading scanned receipts with spaces in the filename fails on Android.
The Problem:
When a receipt file is uploaded on Android, the file URI is URL-encoded (e.g.,
%20for spaces). The code was passing this encoded URI directly toRNFetchBlob.MediaCollection.copyToMediaStore()without decoding it,causing the API to look for a file with literal
%20characters instead of spaces.The Solution:
Added
decodeURI()to decode the file URI before passing it to the filesystem API. This converts%20back to spaces so the path matches the actual filename on disk.Fixed Issues
$ #74685
PROPOSAL: #74685 (comment)
Tests
Prerequisite: Must have a receipt file with space in its filename
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
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
fix.Android.Scan.receipt.Unable.to.download.a.receipt.in.the.confirmation.page.mp4
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop