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 2023-12-12] [$500] Expense - Expense details report on LHN shows $0.00 request after logging out and logging in #30687

Closed
6 tasks done
kbecciv opened this issue Nov 1, 2023 · 30 comments
Assignees
Labels
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

@kbecciv
Copy link

kbecciv commented Nov 1, 2023

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.3.94.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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause- Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Send a money request in the workspace chat.
  3. Open expense details page.
  4. Edit any of the field.
  5. Log out.
  6. Log in.
    Note that it shows $0.00 request in LHN.

Expected Result:

The expense details report shows the correct amount in LHN.

Actual Result:

The expense details report on LHN shows $0.00 request after logging out and logging back in.

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

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Bug6259283_1698837554316.20231101_132104.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014336ba9c8fb45e52
  • Upwork Job ID: 1719693016396517376
  • Last Price Increase: 2023-11-01
  • Automatic offers:
    • fedirjh | Reviewer | 27648732
    • tienifr | Contributor | 27648735
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 1, 2023
@melvin-bot melvin-bot bot changed the title Expense - Expense details report on LHN shows $0.00 request after logging out and logging in [$500] Expense - Expense details report on LHN shows $0.00 request after logging out and logging in Nov 1, 2023
Copy link

melvin-bot bot commented Nov 1, 2023

Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

Copy link

melvin-bot bot commented Nov 1, 2023

Job added to Upwork: https://www.upwork.com/jobs/~014336ba9c8fb45e52

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 1, 2023
Copy link

melvin-bot bot commented Nov 1, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Nov 1, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Nov 1, 2023

Proposal

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

The expense details report on LHN shows $0.00 request after logging out and logging back in.

What is the root cause of that problem?

Here, we try to get the transaction report name based on the transaction, which is only loaded after we open that report. So initially it's always {}, causing the LHN to show 0 amount

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

As the latest expectation is not to depend on the availablity of parentReportAction or transaction. Here we have two scenarios:

  1. parentReportAction is unavailable:

We should have a fixed default fallback (Money request for example). To do this we could early return the fallback before this line.

  1. parentReportAction is available but transaction isn't

We need to fallback to the parentReportActionMessage text here if the transaction is empty. parentReportActionMessage is constructed from the back-end and always correct in case of first loading of the LHN. We only need getTransactionReportName for cases like optimistic update of the transaction details, which means we already OpenReport on the transaction report and already have non-empty transaction.

This can be done by adding a parentReportActionMessage as a new params of getTransactionReportName, and early return it here if the transaction is empty.

What alternative solutions did you explore? (Optional)

For 2, alternatively, we can add a condition here to check that the transaction is not empty. If it's not empty, it won't return the getTransactionReportName and will fallback to the parentReportActionMessage

@melvin-bot melvin-bot bot added the Overdue label Nov 3, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Nov 3, 2023

Thank you @tienifr for the proposal, the alternative solution makes more sense to me. it seems that the transaction is loaded only when the report is opened and it's not included in the openApp command. I think it's safe to fallback to parentReportActionMessage if the transaction is empty, here is an example of empty transaction, as we can see parentReportActionMessage holds the correct message.

Screenshot 2023-11-03 at 5 30 30 PM

Let's proceed with @tienifr proposal.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 3, 2023

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

@puneetlath
Copy link
Contributor

Just to make sure I understand, the parentReportActionMessage comes from getting the parentReportActionID of the report and then looking in reportActions for that reportActionID's message, is that right? If so, is the parentReportAction returned in openApp?

@fedirjh
Copy link
Contributor

fedirjh commented Nov 4, 2023

the parentReportActionMessage comes from getting the parentReportActionID of the report and then looking in reportActions for that reportActionID's message, is that right

Yes, that is correct. Here, we get the parent report action:

const parentReportAction = ReportActionsUtils.getParentReportAction(report);

Here, we get the message :

const parentReportActionMessage = lodashGet(parentReportAction, ['message', 0, 'text'], '').replace(/(\r\n|\n|\r)/gm, ' ');

If so, is the parentReportAction returned in openApp?

Yes, the issue is with transaction which is used to get the report name for money request, the transaction is not returned inside openApp

@puneetlath
Copy link
Contributor

Ok interesting. I'm surprised we return the parent reportAction in openApp. I thought we only returned whatever was needed for the LHN. We return it even if it isn't the most recent reportAction in the parent report?

I just tested and it seems that we do, but I'm also looking at the back-end code and not seeing where we do that. So I just want to be sure that this will actually solve the problem.

@tienifr
Copy link
Contributor

tienifr commented Nov 7, 2023

@puneetlath Then what's your final decision on this? As I don't have access to BE code, that's my observation from API response. If needed, I can create a POC.

@melvin-bot melvin-bot bot added the Overdue label Nov 7, 2023
@puneetlath
Copy link
Contributor

@tienifr I think we need a solution that doesn't count on the parentReportAction or transaction being available.

@melvin-bot melvin-bot bot removed the Overdue label Nov 8, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Nov 8, 2023

I think we need a solution that doesn't count on the parentReportAction or transaction being available.

@puneetlath What should be the expected behavior if we don't have the required data to display the correct amount ? should we display a placeholder like TBD ?

@puneetlath
Copy link
Contributor

Good question. Perhaps we just go with "Request" in that scenario.

@tienifr
Copy link
Contributor

tienifr commented Nov 8, 2023

@puneetlath Thanks. Updated my proposal following the latest expectation.

In case the parentReportAction is not available, we'll return the default placeholder as confirmed above. If it's available however, it will still be used as the fallback.

cc @fedirjh

@melvin-bot melvin-bot bot added the Overdue label Nov 10, 2023
@CortneyOfstad
Copy link
Contributor

@fedirjh bump on the proposal above ^^^ thanks!

@melvin-bot melvin-bot bot removed the Overdue label Nov 10, 2023
@puneetlath
Copy link
Contributor

Sounds good to me too. Thanks for the discussion.

Copy link

melvin-bot bot commented Nov 13, 2023

📣 @tienifr 🎉 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 Nov 13, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 14, 2023
@tienifr
Copy link
Contributor

tienifr commented Nov 14, 2023

PR ready for review #31302.

@puneetlath
Copy link
Contributor

How's this going?

@fedirjh
Copy link
Contributor

fedirjh commented Nov 21, 2023

How's this going?

Found a little bug during PR review #31302 (comment) and it's still awaiting @tienifr inputs.

Copy link

melvin-bot bot commented Nov 28, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 5, 2023
@melvin-bot melvin-bot bot changed the title [$500] Expense - Expense details report on LHN shows $0.00 request after logging out and logging in [HOLD for payment 2023-12-12] [$500] Expense - Expense details report on LHN shows $0.00 request after logging out and logging in Dec 5, 2023
Copy link

melvin-bot bot commented Dec 5, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 5, 2023
Copy link

melvin-bot bot commented Dec 5, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.7-4 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 2023-12-12. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue — @tienifr paid $500 via Upwork
  • Contributor+ that helped on the issue and/or PR — @fedirjh paid $500 via Upwork

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

Copy link

melvin-bot bot commented Dec 5, 2023

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:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] 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:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] 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.
  • [@CortneyOfstad] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/350282

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 11, 2023
@CortneyOfstad CortneyOfstad removed the Awaiting Payment Auto-added when associated PR is deployed to production label Dec 13, 2023
@CortneyOfstad
Copy link
Contributor

@fedirjh any update on the checklist above?

Also, payment has been completed to both you & @tienifr 👍

@melvin-bot melvin-bot bot removed the Overdue label Dec 13, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Dec 13, 2023

BugZero Checklist:

  • Link to the PR: I think the root cause of the issue is from the backend, it seems that we don’t send transaction data inside openApp command.
  • Link to discussion: N/A
  • Determine if we should create a regression test for this bug: Let's add a regression test to reflect the new updates

Regression Test Proposal

  1. Open App
  2. Send a money request in a workspace chat
  3. Open transaction report
  4. Navigate to another chat
  5. Send a new message
  6. Log out
  7. Log in
  8. Verify that in LHN, the correct amount is shown in the transaction report title for the report created in step 3
  9. Verify that for older transactions, the report title is Request
  • Do we agree 👍 or 👎

@CortneyOfstad
Copy link
Contributor

Regression test created, so closing! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
None yet
Development

No branches or pull requests

5 participants