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-11-20] [$250] Expense-Expense preview is hidden briefly when returning to expense report via header subtitle #49741

Closed
6 tasks done
lanitochka17 opened this issue Sep 25, 2024 · 57 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 25, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.40-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to DM
  3. Submit at least two expenses to the user
  4. Go to transaction thread of the first expense
  5. Click on the header subtitle link to go back to expense report

Expected Result:

The second expense preview will show instantly after returning to expense report via header subtitle (production behavior)

Actual Result:

The second expense preview is hidden briefly after returning to expense report via header subtitle

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

Bug6615158_1727291074734.IOU_thread.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021839062492993280361
  • Upwork Job ID: 1839062492993280361
  • Last Price Increase: 2024-10-30
  • Automatic offers:
    • huult | Contributor | 104757569
Issue OwnerCurrent Issue Owner: @RachCHopkins
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

Triggered auto assignment to @francoisl (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link
Contributor

👋 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:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@francoisl
Copy link
Contributor

I also notice a short delay on production, albeit shorter than on staging. Roughly like 50ms on production, and 200ms on staging.
It doesn't look like there's any API call happening when returning to the parent report, so it's probably not due to anything changing in Onyx.

There's nothing that stands out in the checklist so I'm going to open this up for proposals. Doesn't seem worthy of blocking though.

@francoisl francoisl added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed Hourly KSv2 DeployBlockerCash This issue or pull request should block deployment labels Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

@melvin-bot melvin-bot bot changed the title Expense-Expense preview is hidden briefly when returning to expense report via header subtitle [$250] Expense-Expense preview is hidden briefly when returning to expense report via header subtitle Sep 25, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

@mkzie2
Copy link
Contributor

mkzie2 commented Sep 26, 2024

Proposal

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

The second expense preview is hidden briefly after returning to expense report via header subtitle

What is the root cause of that problem?

  1. The expense preview is hidden briefly

loadNewerChats is called with a delay here because we wrapped it in InteractionManager.runAfterInteractions and requestAnimationFrame

const onStartReached = useCallback(() => {
InteractionManager.runAfterInteractions(() => requestAnimationFrame(() => loadNewerChats(false)));
}, [loadNewerChats]);

That leads isFirstLinkedActionRender ref being updated to false after more delay here

handleReportActionPagination({firstReportActionID: newestReportAction?.reportActionID});

As a result, it takes more time to change reportActions from [preview1] (isFirstLinkedActionRender.current is true) to [preview1, preview 2] (isFirstLinkedActionRender is changed to false)

if (isFirstLinkedActionRender.current) {
return combinedReportActions.slice(indexOfLinkedAction);
}

  1. This happens every time we click on the header subtitle of the transaction thread report

We use goBack with shouldEnforceFallback as true to ensure we navigate to the previous report instead of going back. Then because it's a new screen in the stack, this bug happens as the reason at the point 1.

Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID), true);

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

  1. If we agree that it's not a bug we can do nothing here since this change is added here to fix another bug. If not, we should remove this change and find another solution to fix the issue related to this change.

const onStartReached = useCallback(() => {
InteractionManager.runAfterInteractions(() => requestAnimationFrame(() => loadNewerChats(false)));
}, [loadNewerChats]);

  1. To prevent the flicker when clicking on the header subtitle, we should use Navigation.isNavigationReady here instead of passing shouldEnforceFallback param as true
Navigation.isNavigationReady().then(() => {
    Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));
});

Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID), true);

What alternative solutions did you explore? (Optional)

Copy link

melvin-bot bot commented Oct 1, 2024

@francoisl, @fedirjh Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Oct 1, 2024
@francoisl
Copy link
Contributor

@fedirjh are you available to review the proposal above please?

@fedirjh
Copy link
Contributor

fedirjh commented Oct 2, 2024

Yep, on it.

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2024
Copy link

melvin-bot bot commented Oct 2, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@fedirjh
Copy link
Contributor

fedirjh commented Oct 3, 2024

@mkzie2 Thanks for the proposal. I agree with your analysis . However, the second option in your solution won't work if we deep link to the transaction report first and then navigate back to the expense report.

I also notice a short delay on production, albeit shorter than on staging. Roughly like 50ms on production, and 200ms on staging.

@francoisl This is a regression from #49477 as @mkzie2 mentioned . Should we just leave things as they are and close this issue since the behavior exists in production, or should we revert the changes introduced in #49477 and look for another solution (cc @ikevin127 @huult)? Alternatively, should we keep this open to explore other options?

@mkzie2
Copy link
Contributor

mkzie2 commented Oct 3, 2024

However, the second option in your solution won't work if we deep link to the transaction report first and then navigate back to the expense report.

@fedirjh This case will not work because in this case it's the first time the expense report is rendered and as I mentioned in the RCA, this bug will happen.

const onStartReached = useCallback(() => {
InteractionManager.runAfterInteractions(() => requestAnimationFrame(() => loadNewerChats(false)));
}, [loadNewerChats]);

@ikevin127
Copy link
Contributor

@fedirjh Thanks for the ping!

Should we just leave things as they are and close this issue since the behavior exists in production

I'd vote for close since there was always a small delay in this case. However:

The delay caused by InteractionManager.runAfterInteractions combined with requestAnimationFrame can vary depending on the device's performance and current load. However, in general:

  • InteractionManager.runAfterInteractions queues work to run after all ongoing interactions (like gestures or animations) are completed. The exact timing depends on when the ongoing interactions finish, which can vary but typically happens immediately after the current interaction finishes.

  • requestAnimationFrame schedules the callback to be executed on the next repaint, which is typically around 16.67 milliseconds on a 60Hz display (since the screen refreshes every 16.67ms).

So the total delay would be roughly the time it takes for the current interactions to complete plus one frame delay (around 16.67ms). In most cases, the combined delay will be in the range of 16.67ms to a few hundred milliseconds, depending on how long the interactions take to finish.

Given this, if it's really important to have 0 delay and the expense preview show instantly, I agree that the logic should be adjusted and our PR considered a regression 👍

@huult
Copy link
Contributor

huult commented Oct 4, 2024

@ikevin127 May I ask if a final decision has been made on that case?

@ikevin127
Copy link
Contributor

♻️ We're awaiting on a decision from the people assigned to this issue.

@huult
Copy link
Contributor

huult commented Nov 6, 2024

Thank you all. I will create a pull request after the issue I asked about in the Slack group is resolved. https://expensify.slack.com/archives/C01GTK53T8Q/p1730857949391549

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Nov 6, 2024
@melvin-bot melvin-bot bot changed the title [$250] Expense-Expense preview is hidden briefly when returning to expense report via header subtitle [HOLD for payment 2024-11-20] [$250] Expense-Expense preview is hidden briefly when returning to expense report via header subtitle Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 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 Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.60-3 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-11-20. 🎊

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 19, 2024
Copy link

melvin-bot bot commented Nov 20, 2024

Issue is ready for payment but no BZ is assigned. @RachCHopkins you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

Copy link

melvin-bot bot commented Nov 22, 2024

@francoisl, @huult, @RachCHopkins, @fedirjh Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Nov 22, 2024
@fedirjh
Copy link
Contributor

fedirjh commented Nov 22, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot removed the Overdue label Nov 22, 2024
@huult
Copy link
Contributor

huult commented Nov 22, 2024

@RachCHopkins @francoisl Sorry, I still have not received the payment. Can you help me check? Maybe we have an issue with Upwork?

Copy link

melvin-bot bot commented Nov 26, 2024

@francoisl, @huult, @RachCHopkins, @fedirjh Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Nov 26, 2024
@francoisl
Copy link
Contributor

@RachCHopkins are you available to help with the payments here please?

@RachCHopkins
Copy link
Contributor

I sure am! Sorry guys, my fancy zap malfunctioned and I didn't see the ping! I'll get this sorted out asap.

@melvin-bot melvin-bot bot removed the Overdue label Nov 27, 2024
@RachCHopkins
Copy link
Contributor

Payment Summary:

  • Contributor: @huult to be paid $250 via Upwork
  • Contributor+: @fedirjh to be paid $250 via NewDot Manual Request

Upwork job here

@RachCHopkins
Copy link
Contributor

Contributor has been paid, the contract has been completed, and the Upwork post has been closed.

@garrettmknight
Copy link
Contributor

$250 approved for @fedirjh

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 Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants