-
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
[HOLD for Payment 2024-08-27] [$250] Invoice - Paying invoice as a business results in console error #47187
Comments
Triggered auto assignment to @francoisl ( |
Triggered auto assignment to @greg-schroeder ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
We think this issue might be related to the #vip-bills |
Looks like an App issue - though if the payment goes through not sure if this needs to be a blocker |
ProposalPlease re-state the problem that we are trying to solve in this issue.Invoice - Paying invoice as a business results in console error What is the root cause of that problem?We are not using App/src/components/PopoverMenu.tsx Line 152 in 085b3ad
What changes do you think we should make in order to solve the problem?Update to What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Paying invoice as business throws a console error. What is the root cause of that problem?The error comes from the back button rendering component. App/src/components/PopoverMenu.tsx Lines 149 to 153 in e6546d6
The back button will show if we are on a sub menu. App/src/components/PopoverMenu.tsx Line 231 in e6546d6
The way it works is, when we select an option that has a sub menu, the option index will be added to App/src/components/PopoverMenu.tsx Lines 150 to 151 in e6546d6
But in our case, the parent is undefined. Why? The invoice payment method initially has 2 options, individual and business. When we pay the invoice as business, we optimistically change the invoice receiver type of the report to BUSINESS. Lines 6594 to 6599 in e6546d6
Because of that, the individual option is not added anymore as the payment method App/src/components/SettlementButton.tsx Lines 219 to 221 in e6546d6
leaving us the business as the only option. This triggers the popover menu re-render and when the back button component is trying to get the sub-menu parent, it fails and gets undefined. [individual, business] But if we look at the popover component, we can see that there is already a logic to reset the sub-menu if the menu items/options are changed, App/src/components/PopoverMenu.tsx Lines 197 to 203 in e6546d6
or when the modal closes. App/src/components/PopoverMenu.tsx Lines 210 to 214 in e6546d6
But the menu items re-rendered happen earlier, so we still get the error. What changes do you think we should make in order to solve the problem?Instead of using App/src/components/PopoverMenu.tsx Lines 197 to 203 in e6546d6
|
Job added to Upwork: https://www.upwork.com/jobs/~01c50a9517130ce1f6 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Paying the invoice as a business leads to a console error. What is the root cause of that problem?previouslySelectedItem might be undefined What changes do you think we should make in order to solve the problem?No need to render if previouslySelectedItem undefined src/components/PopoverMenu.tsx const renderBackButtonItem = () => {
const previousMenuItems = getPreviousSubMenu();
const previouslySelectedItem = previousMenuItems[enteredSubMenuIndexes[enteredSubMenuIndexes.length - 1]];
if (!previouslySelectedItem) {
return null;
} What alternative solutions did you explore? (Optional) |
After testing, I think we can go with @bernhardoj's proposal. It effectively resolves the issue by ensuring the state is updated before rendering. I tested it and works fine in a quick test, but we can test it thoroughly in the PR. Thank you for the proposals, @Krishna2323 and @wildan-m. While they addressed the symptom, they did not fully resolve the underlying cause. 🎀👀🎀 C+ reviewed |
Current assignee @francoisl is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
📣 @brunovjk 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
PR is ready cc: @brunovjk |
Note The production deploy automation failed: This should be paid 8/27 according to #47639 prod deploy checklist, confirmed in #47488 (comment). cc: @greg-schroeder |
Regression Test Proposal
|
Payment summary: Contributor: @bernhardoj - $250 - You can make a manual request via ND |
Regression test filed |
Requested in ND. |
$250 approved for @bernhardoj |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.18-7
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): applausetester+nl405@applause.expensifail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team
Action Performed:
Expected Result:
No console errors appear
Actual Result:
Console error appears with the message "Cannot read properties of undefined (reading 'backButtonText"
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6566726_1723213373006.bandicam_2024-08-09_17-18-58-225.mp4
Bug6566726_1723213372999!staging.new.expensify.com-1723213166507.txt
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @brunovjkThe text was updated successfully, but these errors were encountered: