-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: Android - Scan receipt- Unable to download a receipt in the confirmation page #75040
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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