[CP Staging] Stop showing receipt images for cash requests#25800
Conversation
|
@Santhosh-Sellavel @aldo-expensify One of you needs to 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] |
| // For things that don't actually have files we will show the generic receipt icon. | ||
| if (!filename) { | ||
| return {thumbnail: null, image: ReceiptGeneric}; | ||
| } |
There was a problem hiding this comment.
I think this is better placed right after if (path.startsWith('blob:') || path.startsWith('file:')) {. So if the function is called with a path and no filename we still return return {thumbnail: null, image: path}; like we used to
|
We were sending this update via Pusher here, but now I see that's just completely gone on main 🤔 |
|
Gonna address that here |
|
Updating the solution here to only return transactions that have |
| */ | ||
| function hasReceipt(transaction) { | ||
| return !_.isEmpty(lodashGet(transaction, 'receipt')); | ||
| return Boolean(lodashGet(transaction, 'receipt.receiptID')); |
There was a problem hiding this comment.
We don't create receiptID optimistically, so this change would prevent images from showing before we get a receiptID back from the client
There was a problem hiding this comment.
Can you respond to me here -> https://expensify.slack.com/archives/C057F53HR40/p1692826510517379?thread_ts=1692826029.393829&cid=C057F53HR40
…if a transaction has a receipt
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
| */ | ||
| function hasReceipt(transaction) { | ||
| return !_.isEmpty(lodashGet(transaction, 'receipt')); | ||
| return Boolean(lodashGet(transaction, 'receipt.source')); |
There was a problem hiding this comment.
| return Boolean(lodashGet(transaction, 'receipt.source')); | |
| const source = lodashGet(transaction, 'receipt.source'); | |
| return source.startsWith('blob:') || source.startsWith('file:') || Boolean(lodashGet(transaction, 'receipt.filename')); |
Something like that? the invalid receipt has a source "https://staging.expensify.com/receipts/", so this function is still return true when it shouldn't
|
Using the |
aldo-expensify
left a comment
There was a problem hiding this comment.
Tested well for me!
mountiny
left a comment
There was a problem hiding this comment.
Thanks for the fix ❤️ 🙇
|
I think thats unrelated but worth posting in bugs I guess Going to merge now since Carlos approved before already |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
[CP Staging] Stop showing receipt images for cash requests (cherry picked from commit f0eeac6)
Yes unrelated to this change - but related to the flow since editing the transaction is what triggers it so maybe you are interested. Broken on dev only AFAICT. Does not appear to be on staging yet so not a deploy blocker. Thanks!!!! |
|
@marcaaron do you have reproduction steps for that screenshot there? Will be helpful 🙇 |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.56-22 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.58-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.58-5 🚀
|






Details
Figured out the root cause after discussing with @luacmartins and @mountiny
Fixed Issues
$ #25795
Tests
Offline tests
❌
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android
Android is still building... 🥲