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] [Performance] Slow load of one-transaction reports #44162

Closed
puneetlath opened this issue Jun 21, 2024 · 19 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

Comments

@puneetlath
Copy link
Contributor

puneetlath commented Jun 21, 2024

One transaction reports seem to load slower than regular reports or regular transactions. And they have a weird UI while they are loading where the report looks like a one-transaction report, but there is also that same expense attached to the report as a comment.

Let's fix this by fixing the weird UI while loading and making loading faster.

Context here: https://expensify.slack.com/archives/C05LX9D6E07/p1718718047425429?thread_ts=1718652645.370349&cid=C05LX9D6E07

Issue OwnerCurrent Issue Owner: @VictoriaExpensify / @VictoriaExpensify
@puneetlath puneetlath added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 21, 2024
@puneetlath puneetlath self-assigned this Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

Triggered auto assignment to @VictoriaExpensify (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.

@puneetlath puneetlath changed the title Slow load of one-transaction reports. Slow load of one-transaction reports Jun 21, 2024
@puneetlath puneetlath changed the title Slow load of one-transaction reports [Performance][ Slow load of one-transaction reports Jun 21, 2024
@puneetlath puneetlath changed the title [Performance][ Slow load of one-transaction reports [Performance]Slow load of one-transaction reports Jun 21, 2024
@puneetlath puneetlath changed the title [Performance]Slow load of one-transaction reports [Performance] Slow load of one-transaction reports Jun 21, 2024
@rinej
Copy link
Contributor

rinej commented Jun 21, 2024

Hello it's Tomek from Callstack, I would like to work on that

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
@rinej
Copy link
Contributor

rinej commented Jun 24, 2024

It looks like there's an error when displaying the ReportAction in ReportActionItem.tsx. Essentially, the app initially renders the previous report and then updates it after it has already been rendered. This issue might be caused by Onyx's optimistic approach, but it seems it could be fixed with a simple condition check. I'm currently investigating this further.

@puneetlath
Copy link
Contributor Author

Ok sounds good!

@rinej
Copy link
Contributor

rinej commented Jun 26, 2024

I noticed two causes of that issue:

The first was that the MoneyReportView was being displayed even when there were no transactions in the current state (optimistic approach). This led to the view covering the screen unnecessarily, and once the transactions were fetched, it disappeared, causing a flickering effect. To address this, I adjusted the logic to ensure that the MoneyReportView is only displayed when there are transactions to show.

The second issue was with the IOU message action in the one-view transaction screen. By default, the IOU action was displayed, even though it was not supposed to be shown. It would only be removed after several re-renders, which caused the flickering effect. To fix this, I implemented filtering logic to remove the IOU action before the view is rendered.

I am preparing a draft PR for these changes and will proceed with some testing to ensure that these adjustments do not break other flows

@puneetlath
Copy link
Contributor Author

Ok awesome. We can also make a test build and I can see if it solves the issue in my account.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jun 27, 2024
@rinej
Copy link
Contributor

rinej commented Jun 27, 2024

That would be great! Here is the PR -> #44529

I am using not very heavy account, but still I could see the flickering, so at your account the fix would be more visible, please let me know :)

Copy link

melvin-bot bot commented Jul 8, 2024

⚠️ 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 Jul 15, 2024
@melvin-bot melvin-bot bot changed the title [Performance] Slow load of one-transaction reports [HOLD for payment 2024-07-22] [Performance] Slow load of one-transaction reports Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label 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:

  • @rinej does not require payment (Contractor)
  • @mkhutornyi requires payment (Needs manual offer from BZ)

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:

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

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

melvin-bot bot commented Jul 22, 2024

Payment Summary

Upwork Job

  • Contributor: @rinej is from an agency-contributor and not due payment
  • ROLE: @mkhutornyi paid $(AMOUNT) via Upwork (LINK)

BugZero Checklist (@puneetlath)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@melvin-bot melvin-bot bot added the Overdue label Jul 24, 2024
@puneetlath
Copy link
Contributor Author

@mkhutornyi can you do the checklist? And @VictoriaExpensify can you handle payment?

@mkhutornyi
Copy link
Contributor

Regression Test Proposal

  1. Create new Workspace with user A
  2. Invite another member to it - user B
  3. As user A, Go to the Workspace settings > More Features > Enable Workflows
  4. Setup approvals
  5. Set user A as the Approver on the workspace
  6. Log out
  7. Sign in as B
  8. Submit expense in that workspace
  9. Sign in as A and navigate to the chat with B and open the expense report
  10. Navigate back
  11. Open another expense report
  12. Verify that report loads without flickering (no previous report action is seen)

@melvin-bot melvin-bot bot added the Overdue label Jul 29, 2024
@VictoriaExpensify
Copy link
Contributor

@mkhutornyi - I have invited you to accept the Upwork Job. Please let me know once you have accepted it and I'll fix up your payment.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 29, 2024
Copy link

melvin-bot bot commented Aug 1, 2024

@puneetlath, @rinej, @VictoriaExpensify, @mkhutornyi Whoops! This issue is 2 days overdue. Let's get this updated quick!

@VictoriaExpensify
Copy link
Contributor

@mkhutornyi - let me know once you've accepted the offer in Upwork :)

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 1, 2024
Copy link

melvin-bot bot commented Aug 5, 2024

@puneetlath, @rinej, @VictoriaExpensify, @mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@VictoriaExpensify
Copy link
Contributor

VictoriaExpensify commented Aug 5, 2024

Payment Summary:
Contributor: @rinej is from an agency-contributor and not due payment
ROLE: @mkhutornyi paid $250 via [Upwork](Upwork Job)

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
Projects
Development

No branches or pull requests

4 participants