-
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] fix regression copy to clipboard #30818
[CP Staging] fix regression copy to clipboard #30818
Conversation
@@ -4087,7 +4087,7 @@ function getIOUReportActionDisplayMessage(reportAction) { | |||
let displayMessage; | |||
if (originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { | |||
const {IOUReportID} = originalMessage; | |||
const {amount, currency} = originalMessage.IOUDetails; | |||
const {amount, currency} = originalMessage.IOUDetails || originalMessage; |
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 don't understand this.
This at least requires an explanation comment. Where are {amount, currency}
expected to reside? Why are there sometimes here, sometimes here?
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.
Both of these values were expected to reside in the root level, but for only our original issue that we fixed, only in that case it is coming inside ioudetails key
It has to be similar behaviour across all the scenarios, if we don't go with this PR we have to revert the original pr which caused this regression and then handle it from backend
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.
@Gonals @marcaaron I approved this as it's a deploy blocker, but I didn't really get the explanation above and I still believe something should be done here. I'm just not completely sure what.
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.
Both of these values were expected to reside in the root level, but for only our original issue that we fixed, only in that case it is coming inside ioudetails key
I need help understanding this. Would you re-phrase this sentence?
the original pr which caused this regression
Do you have a specific PR in mind?
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.
Original PR -> my last PR which caused this regression
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.
Original PR -> my last PR which caused this regression
Oh, sure 👍
Still, we need to sketch a plan for removing this originalMessage.IOUDetails || originalMessage
expression long-term. Do I understand correctly that you suggested that this inconsistency starts on the backend side?
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.
Yes! I saw this inconsistency. I still have to take it to slack
Did not do due to being hospitalised from past few days.
Just replying to this chat so that I don't miss anything
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.
Oh, I'm sorry about your situation 🙁 If your health situation makes it difficult or impossible to work on this, let us know. We might put this on hold for the time of your recovery or something like that.
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.
When money is sent (using send money) we store there details in IOUDetails
, when money request is paid, the amount and currency is in the originalMessage
field
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.
Huh? That seems weird 😄 Is there some way to explicitly tell whether it's one or the other? Maybe the code should have a comment about it if we are not going to improve this.
@saranshbalyan-1234 thanks for the PR, and @cubuspl42 thanks for approving - did you test on all platforms? 🙏 I agree - if this fixes the blocker, let's move forward - but let's not forget this convo about making this code better |
Reviewer Checklist
Screenshots/VideosWebfix-regression-copy-to-clipboard-web.mp4Mobile Web - Chromefix-regression-copy-to-clipboard-android-web-compressed.mp4Mobile Web - Safarifix-regression-copy-to-clipboard-ios-web.mp4Desktopfix-regression-copy-to-clipboard-desktop.mp4iOSfix-regression-copy-to-clipboard-ios.mp4Androidfix-regression-copy-to-clipboard-android-compressed.mp4 |
I just filled the whole checklist, with videos |
@saranshbalyan-1234 can you please start a thread in slack (in #expensify-open-source), tagging me & anyone else involved who knows why we need to look in both places for amount & currency so that we can hopefully clean this up before we forget about it? 🙏 |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
…-to-clipboard fix regression copy to clipboard (cherry picked from commit f498830)
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 1.3.95-3 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.95-9 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.97-7 🚀
|
Details
Fixed Issues
$ #30796
PROPOSAL:
Tests
Offline tests
Same as QA steps
QA Steps
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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop