App icon indicating copy to clipboard operation
App copied to clipboard

After editing split expense amount weird flash and reloads at the top

Open m-natarajan opened this issue 9 months ago β€’ 1 comments

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: 1.4.67-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: @roryabraham Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1714161321481359

Action Performed:

  1. Create a group
  2. Scan a receipt to split a bill in the group which has full screen of chat messages
  3. Manually set the amount on the bill split

Expected Result:

The amount should update, and nothing else should happen.

Actual Result:

The amount updates, then the report "flashes" and reloads at the top, then scrolls down to the bottom, without you touching anything.

Workaround:

unknown

Platforms:

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

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [x] iOS: Native
  • [ ] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/38435837/82bec8e2-0c90-42c9-9b47-4b398a09bc7f

View all open jobs on GitHub

m-natarajan avatar Apr 28 '24 16:04 m-natarajan

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

melvin-bot[bot] avatar Apr 28 '24 16:04 melvin-bot[bot]

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

melvin-bot[bot] avatar Apr 28 '24 18:04 melvin-bot[bot]

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

melvin-bot[bot] avatar Apr 28 '24 18:04 melvin-bot[bot]

Posted on slack to attract proposals

eh2077 avatar May 01 '24 08:05 eh2077

Not overdue, still waiting for proposals

eh2077 avatar May 04 '24 16:05 eh2077

Proposal

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

After editing split expense amount weird flash and reloads at the top

What is the root cause of that problem?

As shown in the attachment, the CompleteSplitBill returns data where the most recent previousReportActionID is 0. However, in the local data, this ID corresponds to the number of the previous order. This discrepancy causes the reportActions to refresh when the network response is received, leading to a page refresh.

As shown in the first code snippet, by adding debugging code on line 794, you will notice that the previousReportActionID changes from an initial value to 0 and then reverts back to the original value. The debugging line of code would look like this:

console.log(
'ReportScreen', 
prevProps.sortedAllReportActions[0].previousReportActionID, nextProps.sortedAllReportActions[0].previousReportActionID);

https://github.com/Expensify/App/blob/ab1e924bf0d4f928a9006f5bdd6b9da60346b1df/src/pages/home/ReportScreen.tsx#L787-L815

Due to the changes in previousReportActionID, line 268 of the ReportActionsUtils.getContinuousReportActionChain function returns different values, causing changes in reportActions and subsequently triggering a redraw of the screen.

https://github.com/Expensify/App/blob/ab1e924bf0d4f928a9006f5bdd6b9da60346b1df/src/pages/home/ReportScreen.tsx#L264-L269

condition in Line 317

https://github.com/Expensify/App/blob/ab1e924bf0d4f928a9006f5bdd6b9da60346b1df/src/libs/ReportActionsUtils.ts#L290-L344

request.txt response.json

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

Fix Backend return the expect value

What alternative solutions did you explore? (Optional)

Or add condition in ReportActionsUtils.ts#L317 except previousReportActionID equal 0

charles-liang avatar May 05 '24 12:05 charles-liang

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar May 05 '24 16:05 melvin-bot[bot]

@charles-liang Thanks for your proposal. Your RCA is correct and I agreed with you this issue should be fixed by the backend. StartSplitBill returns the correct previousReportActionID image While CompleteSplitBill returns wrong previousReportActionID. image

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

eh2077 avatar May 06 '24 03:05 eh2077

Current assignee @roryabraham is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] avatar May 06 '24 03:05 melvin-bot[bot]

ok, I keep seeing a number of issues with incorrect previousReportActionID generated in the back-end

roryabraham avatar May 08 '24 22:05 roryabraham

Current assignee @eh2077 is eligible for the Internal assigner, not assigning anyone new.

melvin-bot[bot] avatar May 08 '24 22:05 melvin-bot[bot]

@roryabraham @laurenreidexpensify @eh2077 this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar May 12 '24 18:05 melvin-bot[bot]

I think @roryabraham will take care of this from the backend. Once the backend fix is done, we can retest it to determine if it's good to close the issue.

eh2077 avatar May 13 '24 12:05 eh2077

@roryabraham can you confirm if you're going to be working on this or if it needs a hot pick label?

arielgreen avatar May 13 '24 14:05 arielgreen

I'm still working on this, though it won't necessarily be back-end. I'm writing up a thorough P/S in this doc

roryabraham avatar May 17 '24 20:05 roryabraham

Requested retest: https://expensify.slack.com/archives/C9YU7BX5M/p1715988615903839

roryabraham avatar May 17 '24 23:05 roryabraham

Bug is still able to reproduce.

https://github.com/Expensify/App/assets/43996225/6b0da52e-bf4a-458b-a4eb-6504d7c5dc77

kavimuru avatar May 18 '24 01:05 kavimuru

@roryabraham moved the status of this bug to in progress since you are working on it. since the priority is high, i am gonna make this a daily!

saracouto avatar May 21 '24 18:05 saracouto

I spent prettymuch the whole day working on this problem over here, lots and lots of context in there πŸ˜…

roryabraham avatar May 22 '24 00:05 roryabraham

Going to put this on HOLD for https://github.com/Expensify/App/issues/41254 the sake of consolidation. This has been my top priority, and we've been actively working on it as you can see in the slack thread. But I have like 4 different GitHub issues under the same β˜‚οΈ and they haven't all been getting the same love

roryabraham avatar May 24 '24 21:05 roryabraham

still "on HOLD", still prettymuch my top priority (along with all other issues in the same β˜‚οΈ)

roryabraham avatar May 29 '24 22:05 roryabraham

Issue not reproducible during KI retests. (First week)

mvtglobally avatar Jun 05 '24 21:06 mvtglobally

HOLDing, we have recent activity in https://github.com/Expensify/App/pull/41962

roryabraham avatar Jun 11 '24 00:06 roryabraham

Current assignee @laurenreidexpensify is eligible for the Bug assigner, not assigning anyone new.

melvin-bot[bot] avatar Jun 18 '24 11:06 melvin-bot[bot]

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

melvin-bot[bot] avatar Jun 18 '24 11:06 melvin-bot[bot]

@sonialiap another parental leave one - there is no action on this required this week, it's on hold and @roryabraham is working on it. Thanks!

laurenreidexpensify avatar Jun 18 '24 11:06 laurenreidexpensify

This issue has not been updated in over 15 days. @sonialiap, @roryabraham, @eh2077 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[bot] avatar Jul 17 '24 18:07 melvin-bot[bot]

I'm OOO Aug 19-30, but this is monthly so not adding a BZ leave buddy

sonialiap avatar Aug 16 '24 12:08 sonialiap

@sonialiap, @roryabraham, @eh2077, this Monthly task hasn't been acted upon in 6 weeks; closing.

If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

melvin-bot[bot] avatar Sep 12 '24 18:09 melvin-bot[bot]