Recreate a receipt for native#54358
Conversation
…/51761-recreate-receipt
…/51761-recreate-receipt
…/51761-recreate-receipt
…emove unused functions
…/51761-recreate-receipt
…/51761-recreate-receipt
|
@allgandalf 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] |
|
I struggle to build Android so I haven't attached a video to this platform. Please build it on your side. |
|
sure thing! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
…/51761-recreate-receipt
neil-marcellini
left a comment
There was a problem hiding this comment.
Thanks for the updates, good to go
|
Oh, actually unit tests are failing @rezkiy37 |
|
@rezkiy37 can you please fix conflicts when you're online 😄 |
|
@allgandalf, done 🙂 |
neil-marcellini
left a comment
There was a problem hiding this comment.
I'm not really understanding why you changed the assertions for one of the tests, it seems wrong. Also, I see that you mocked the fileDownload util in almost all of the tests, then had to change many files to use named imports, I assume because this PR now touches those files.
Instead, can we set up a single global mock for all the tests, and then the PR won't have to change so many files? Please let me know if you have different ideas.
I've integrated the mock globally. I reverted many changes. It works properly now. |
neil-marcellini
left a comment
There was a problem hiding this comment.
Thanks for the fixes, I think it's good to go.
|
✋ 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/neil-marcellini in version: 9.0.92-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.92-6 🚀
|
| if (key === 'receipt' && initiatedOffline) { | ||
| const {uri: path = '', source} = value as File; | ||
|
|
||
| return readFileAsync(source, path, () => {}).then((file) => { |
There was a problem hiding this comment.
Coming from #76975, we should use the actual file name if available, otherwise fall back to extracting from path/uri
Explanation of Change
The PR fixes a case when submitting the scanned expense is errored when the user kills the app while the request is in the queue. I propose reconstructing a blob of the receipt if the request is created while the user is offline.
Fixed Issues
$ #51761
PROPOSAL: #51761 (comment)
Tests
Offline tests
Same as 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 stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Android: mWeb Chrome
Android.Chrome.mp4
iOS: Native
IOS.mp4
iOS: mWeb Safari
IOS.Safari.mp4
MacOS: Chrome / Safari
Desktop.mp4
MacOS: Desktop
Desktop.mp4