-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[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] |
src/libs/ReceiptUtils.js
Outdated
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
src/libs/TransactionUtils.js
Outdated
@@ -79,7 +79,7 @@ function buildOptimisticTransaction( | |||
* @returns {Boolean} | |||
*/ | |||
function hasReceipt(transaction) { | |||
return !_.isEmpty(lodashGet(transaction, 'receipt')); | |||
return Boolean(lodashGet(transaction, 'receipt.receiptID')); |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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.
src/libs/TransactionUtils.js
Outdated
@@ -79,7 +79,7 @@ function buildOptimisticTransaction( | |||
* @returns {Boolean} | |||
*/ | |||
function hasReceipt(transaction) { | |||
return !_.isEmpty(lodashGet(transaction, 'receipt')); | |||
return Boolean(lodashGet(transaction, 'receipt.source')); |
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.
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 |
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.
Tested well for me!
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.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android
Android is still building... 🥲