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

[Due for payment 2025-02-18] [$250] Expense - In offline, on creating second split expense user not scrolled down to new expense. #54528

Closed
2 of 8 tasks
IuliiaHerets opened this issue Dec 24, 2024 · 18 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

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 24, 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.78-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
Issue reported by: Applause Internal Team
Device used: Redmi note 10s Android 13
App Component: Money Requests

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Go offline
  3. Tap fab --start chat& Create a group chat
  4. Create a split expense
  5. Create a second split expense

Expected Result:

In offline, on creating second split expense user must be scrolled down to new expense.

Actual Result:

In offline, on creating second split expense user not scrolled down to new expense.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6701767_1735043939052.Screenrecorder-2024-12-24-17-59-30-74_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021871673363207753108
  • Upwork Job ID: 1871673363207753108
  • Last Price Increase: 2024-12-31
  • Automatic offers:
    • FitseTLT | Contributor | 105536567
Issue OwnerCurrent Issue Owner: @getusha
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

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

@FitseTLT
Copy link
Contributor

FitseTLT commented Dec 24, 2024

Edited by proposal-police: This proposal was edited at 2024-12-24 14:06:08 UTC.

Proposal

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

Expense - In offline, on creating second split expense user not scrolled down to new expense.

What is the root cause of that problem?

hasNewestReportAction is becoming false here so we are early returning without scrolling to bottom

if (!hasNewestReportActionRef.current) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID));
return;
}
reportScrollManager.scrollToBottom();

this is because when report prop passed to report action list is memorized here with the dependency being reportOnyx object
policyAvatar: reportOnyx.policyAvatar,
pendingChatMembers: reportOnyx.pendingChatMembers,
},
[reportOnyx, permissions],

but adding object as a dependency will only change the value on change of the object reference and in this case it is not changing and the memo is not recalculating on the change of report.lastVisibleActionCreated and up-to-date report data is not provided for ReportActionList so hasNewestReportAction will be false preventing the scroll
The reason why it is only happening for split is because we are directly getting the object reference of the object here
and directly setting/mutating the object here and directly setting the object in optimistic data here

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

We have options to solve it

  1. we can clone the report object from onyx via spreading or deep clone here
    let existingSplitChatReport = existingChatReportID ? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${existingChatReportID}`] : null;
    let existingSplitChatReport = existingChatReportID ? {...allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${existingChatReportID}`]} : null;

and apply the same fixes if we have same problem of directly mutating onyx data and setting in optimistic data in other cases too
2. We can specifically add the prop of the reportOnyx in the dependency. To solve this issue adding the report.lastVisibleActionCreated as a dependency suffices but we need to add the other props too that we are defining in the useMemo

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

We can also directly pass the whole reportOnyx to ReportActionsView but I think we are intentionally memorizing to only re-render on only relevant data for performance reasons.

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Dec 24, 2024
@melvin-bot melvin-bot bot changed the title Expense - In offline, on creating second split expense user not scrolled down to new expense. [$250] Expense - In offline, on creating second split expense user not scrolled down to new expense. Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

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

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

melvin-bot bot commented Dec 24, 2024

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

Copy link

melvin-bot bot commented Dec 30, 2024

@sakluger, @getusha Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Dec 30, 2024
@sakluger
Copy link
Contributor

I think @getusha may be on vacation. I'm going to leave the issue as is for the rest of this week, if he's not back yet then we can reassign to keep things moving.

Copy link

melvin-bot bot commented Dec 31, 2024

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

Copy link

melvin-bot bot commented Jan 1, 2025

@sakluger, @getusha Still overdue 6 days?! Let's take care of this!

@getusha
Copy link
Contributor

getusha commented Jan 1, 2025

@FitseTLT's proposal looks good to me!
The RCA makes sense and the solution works well. (1st solution)
🎀 👀 🎀 C+ Reviewed

@melvin-bot melvin-bot bot removed the Overdue label Jan 1, 2025
Copy link

melvin-bot bot commented Jan 1, 2025

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 2, 2025
Copy link

melvin-bot bot commented Jan 2, 2025

📣 @FitseTLT 🎉 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 📖

Copy link

melvin-bot bot commented Jan 27, 2025

This issue has not been updated in over 15 days. @cead22, @sakluger, @FitseTLT, @getusha eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 labels Feb 11, 2025
@melvin-bot melvin-bot bot changed the title [$250] Expense - In offline, on creating second split expense user not scrolled down to new expense. [Due for payment 2025-02-18] [$250] Expense - In offline, on creating second split expense user not scrolled down to new expense. Feb 11, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 11, 2025
Copy link

melvin-bot bot commented Feb 11, 2025

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

Copy link

melvin-bot bot commented Feb 11, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.95-6 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 2025-02-18. 🎊

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

Copy link

melvin-bot bot commented Feb 11, 2025

@getusha @sakluger @getusha The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 17, 2025
@sakluger
Copy link
Contributor

sakluger commented Feb 18, 2025

Summarizing payment on this issue:

Contributor: @FitseTLT $250, paid via Upwork
Contributor+: @getusha $250, please request on Newdot

@getusha
Copy link
Contributor

getusha commented Feb 20, 2025

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 (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: https://github.com/Expensify/App/pull/43021/files#r1963429155

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/a

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Since it's an offline issue and doesn't affect important flows, I don't think this bug is impactful enough to have a regression test.

@sakluger
Copy link
Contributor

Thanks! Payment summary is here: #54528 (comment)

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
None yet
Development

No branches or pull requests

5 participants