-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Make payment flow independent on existance of report preview #26891
Conversation
src/libs/actions/IOU.js
Outdated
...(optimisticReportPreviewAction | ||
? [ | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`, | ||
value: { | ||
[optimisticReportPreviewAction.reportActionID]: optimisticReportPreviewAction, | ||
}, | ||
}, | ||
] | ||
: [] | ||
), |
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'm not really a fan of adding the spread operator, and the ternary, and the empty arrays. I think that makes it very confusing to know what's going on. What I would suggest is to do something more like:
if (optimisticReportPreviewAction) {
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
value: {
[optimisticReportPreviewAction.reportActionID]: optimisticReportPreviewAction,
},
});
}
@ 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] |
Reviewer ChecklistThis is a bit unorthodox, but since we're dealing with a fire for the SBE launch, I am making the call to skip full-platform testing. I tested it on web and it worked: Skipping the rest of the reviewer checklist and @hayata-suenaga you don't need to do anything 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.
Looks good now, thank you.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🧪🧪 Use the links below to test this build in android and iOS. Happy testing! 🧪🧪
|
🚀 Deployed to staging by https://github.com/tgolen in version: 1.3.65-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.65-7 🚀
|
🚀 Deployed to staging by https://github.com/tgolen in version: 1.3.66-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.66-3 🚀
|
Details
When the report preview which is a parent of the IOU/ expense report is s whisper and the admin/ payer is not in the list of accounts to whisper the action to, they do not have that action locally. This leads to error and inability to pay the expense report, because the optimistic actions are updating the report preview assuming its always there.
Fixed Issues
$ https://expensify.slack.com/archives/C05DWUDHVK7/p1694017256052129?thread_ts=1693949568.506649&cid=C05DWUDHVK7
Tests
Offline tests
N/A
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
26891web.mp4
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android