Skip to content
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-07-22] [HOLD for payment 2024-07-17] [$250] Send invoice - "To" field displays Hidden instead of invoice receiver #43917

Closed
6 tasks done
lanitochka17 opened this issue Jun 18, 2024 · 24 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Jun 18, 2024

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: 1.4.85-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Send invoice.
  3. Send invoice to a user.
  4. Go to invoice chat.
  5. Go to + > Send invoice.
  6. Enter amount > Next.

Expected Result:

"To" field will display the invoice receiver

Actual Result:

"To" field displays Hidden instead of invoice receiver

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

20240618_211242.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013c79d3cbeca420a5
  • Upwork Job ID: 1803182751188551607
  • Last Price Increase: 2024-06-18
  • Automatic offers:
    • bernhardoj | Contributor | 102868154
Issue OwnerCurrent Issue Owner: @slafortune
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 18, 2024
Copy link

melvin-bot bot commented Jun 18, 2024

Triggered auto assignment to @slafortune (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@slafortune FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@daledah
Copy link
Contributor

daledah commented Jun 18, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

"To" field displays Hidden instead of invoice receiver

What is the root cause of that problem?

When we calculate participants in case of invoice room here we do not pass accountID
so at confirmation step participantAccountID will be equal to -1 and display hidden user here

What changes do you think we should make in order to solve the problem?

We need to pass accountID when we calculate participants

   participants = [
            {reportID: chatReport?.reportID, selected: true, accountID: chatReport?.invoiceReceiver?.accountID},
            {
                policyID: chatReport?.policyID,
                isSender: true,
                selected: false,
            },
        ];

What alternative solutions did you explore? (Optional)

result.mov

@slafortune slafortune added the External Added to denote the issue can be worked on by a contributor label Jun 18, 2024
Copy link

melvin-bot bot commented Jun 18, 2024

Job added to Upwork: https://www.upwork.com/jobs/~013c79d3cbeca420a5

@melvin-bot melvin-bot bot changed the title Send invoice - "To" field displays Hidden instead of invoice receiver [$250] Send invoice - "To" field displays Hidden instead of invoice receiver Jun 18, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 18, 2024
Copy link

melvin-bot bot commented Jun 18, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External)

@bernhardoj
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Hidden user is shown in the To section of send invoice from a chat.

What is the root cause of that problem?

On the confirmation page, the participant is mapped from the transaction participant data.

const participants = useMemo(
() =>
transaction?.participants?.map((participant) => {
const participantAccountID = participant.accountID ?? -1;
if (participant.isSender && iouType === CONST.IOU.TYPE.INVOICE) {
return participant;
}
return participantAccountID ? OptionsListUtils.getParticipantsOption(participant, personalDetails) : OptionsListUtils.getReportOption(participant);
}) ?? [],
[transaction?.participants, personalDetails, iouType],

If the participant has an accountID, we map it with getParticipantsOption, otherwise we map it with getReportOption. If we initiate the send invoice from the room/chat, the participant will contain a reportID, but not accountID.

App/src/libs/actions/IOU.ts

Lines 6651 to 6659 in 904d49d

} else if (ReportUtils.isInvoiceRoom(chatReport)) {
participants = [
{reportID: chatReport?.reportID, selected: true},
{
policyID: chatReport?.policyID,
isSender: true,
selected: false,
},
];

With this information, we expect the participant to be mapped with getReportOption, however, this PR defaults the accountID to -1 (we previously defaulted it to 0).

const participantAccountID = participant.accountID ?? -1;

So, this condition thinks that the participant is a user.

return participantAccountID ? OptionsListUtils.getParticipantsOption(participant, personalDetails) : OptionsListUtils.getReportOption(participant);

What changes do you think we should make in order to solve the problem?

We have 2 options:

  1. No need to set a default value for the accountID. (preferrable)
  2. Instead of checking whether the accountID falsey or not, check whether the value is > 0 or not
return participantAccountID > 0 ? OptionsListUtils.getParticipantsOption(participant, personalDetails) : OptionsListUtils.getReportOption(participant);

@thesahindia
Copy link
Member

@bernhardoj's proposal looks good to me!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 19, 2024

Triggered auto assignment to @Gonals, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Copy link

melvin-bot bot commented Jun 24, 2024

@slafortune, @Gonals, @thesahindia Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot removed the Overdue label Jun 25, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jun 25, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @thesahindia

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 10, 2024
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Jul 10, 2024
@melvin-bot melvin-bot bot changed the title [$250] Send invoice - "To" field displays Hidden instead of invoice receiver [HOLD for payment 2024-07-17] [$250] Send invoice - "To" field displays Hidden instead of invoice receiver Jul 10, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jul 10, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.5-13 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-17. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jul 10, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@thesahindia] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@bernhardoj
Copy link
Contributor

I'll request in ND once payment is due.

@slafortune
Copy link
Contributor

Thanks for the heads up @bernhardoj - I closed the contract for this GH with Upworks

@thesahindia
Copy link
Member

It was caused by the migration PR . It was a huge PR, so it's easy to miss such cases.

We don't need a specific test case here.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 15, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-17] [$250] Send invoice - "To" field displays Hidden instead of invoice receiver [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Send invoice - "To" field displays Hidden instead of invoice receiver Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-22. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jul 15, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@thesahindia] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@bernhardoj
Copy link
Contributor

The payment should be due tomorrow (07-17)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 16, 2024
@bernhardoj
Copy link
Contributor

Requested in ND.

@slafortune
Copy link
Contributor

@bernhardoj is due $250 for the Contributor role via NewDot
@thesahindia is due $250 for the C+ role via NewDot

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@JmillsExpensify
Copy link

$250 approved for @thesahindia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests

7 participants