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

[$500] Request money - The transition between tabs is not smooth after changing the merchant #31193

Closed
4 of 6 tasks
lanitochka17 opened this issue Nov 10, 2023 · 33 comments
Closed
4 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Internal Requires API changes or must be handled by Expensify staff Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 10, 2023

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.3.98-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:

Issue found when executing PR #30420

Action Performed:

  1. Go to URL https://staging.new.expensify.com/
  2. Login with any account
  3. Go to FAB button -> Request
  4. Enter an amount -> Choose an user
  5. Click Show More -> Merchant -> Enter the new data -> Save

Expected Result:

The transition between tabs is smooth

Actual Result:

The transition between tabs is not smooth

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

Bug6271549_1699637835916.Recording__6715.mp4

Bug6271549_1699637835909!image__174_

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0122f38a619454be7f
  • Upwork Job ID: 1723037447965073408
  • Last Price Increase: 2023-12-01
@lanitochka17 lanitochka17 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 10, 2023
@melvin-bot melvin-bot bot changed the title Request money - The transition between tabs is not smooth after changing the merchant [$500] Request money - The transition between tabs is not smooth after changing the merchant Nov 10, 2023
Copy link

melvin-bot bot commented Nov 10, 2023

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

Copy link

melvin-bot bot commented Nov 10, 2023

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

Copy link

melvin-bot bot commented Nov 10, 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

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

melvin-bot bot commented Nov 10, 2023

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

@AmjedNazzal
Copy link
Contributor

I don't understand this one, So the transition is not smooth when changing merchant, it seem not smooth for me when changing description or anything else as well, probably because changing these results in onyx merge which would cause a bit of lag.

@beodw
Copy link

beodw commented Nov 11, 2023

Proposal

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

The navigation after saving the merchant page form is not smooth when creating a new manual money request.

What is the root cause of that problem?

The problem is caused by having to set the new merchant name in onyx using onyx.merge which takes a few milliseconds to set the data and so the animation after the form is saved is interrupted. The updateMerchant calls navigateBack without waiting for the state update to finish.

function updateMerchant(value) { IOU.setMoneyRequestMerchant(value.moneyRequestMerchant); navigateBack(); }

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

We can instead pass the navigate back method to the action that sets the onyx state and wait for the data to be merged. This can be done by adding a .then clause to the onyx merge call to invoke the navigate back function as a call back. Since setting the onyx state happens quickly , in milliseconds, the user will not see any delay before the navigation starts. The code can be modified to remove the navigateBack call as follows.

function updateMerchant(value) { IOU.setMoneyRequestMerchant(value.moneyRequestMerchant, navigateBack); }

And the action that updates onyx can take this as a callback and start the navigation after the state update is complete.

function setMoneyRequestMerchant(merchant, callback) { Onyx.merge(ONYXKEYS.IOU, {merchant: merchant.trim()}) .then((v) => callback()); }

You can see a video of the functionality with the fix implemented below.

Screen.Recording.2023-11-11.at.2.03.26.PM.mov

What alternative solutions did you explore? (Optional)

Alternatively, we could try subscribing to an event for when onyx is done updating its state but this would require an update to its low level pub/sub library so subscribers are notified.

Copy link

melvin-bot bot commented Nov 11, 2023

📣 @beodw! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@beodw
Copy link

beodw commented Nov 11, 2023

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01e23e52119b3f90d6

Copy link

melvin-bot bot commented Nov 11, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@melvin-bot melvin-bot bot added the Overdue label Nov 13, 2023
Copy link

melvin-bot bot commented Nov 14, 2023

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

@sonialiap
Copy link
Contributor

@fedirjh a new proposal, what do you think?

@melvin-bot melvin-bot bot removed the Overdue label Nov 14, 2023
Copy link

melvin-bot bot commented Nov 17, 2023

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

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

fedirjh commented Nov 17, 2023

Checking now

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 17, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Nov 20, 2023

I was not able to reproduce the issue with a normal account on staging:

CleanShot.2023-11-20.at.13.27.37.mp4

@beodw The issue was replicated with A High Traffic Account with 6X CPU slowdown. I was able to replicate with all the fields within the money request flow (amount, description, date).

CleanShot.2023-11-20.at.13.43.34.mp4

@beodw Could you provide further clarification on the root cause? It is unclear to me why Onyx.merge is slow, it could be something else that is causing the issue.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 20, 2023
@sonialiap sonialiap removed the Overdue label Nov 22, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 22, 2023
@sonialiap
Copy link
Contributor

sonialiap commented Dec 4, 2023

I've shared this issue with the Margelo team to see if they're able to pick it up
https://expensify.slack.com/archives/C035J5C9FAP/p1701695631155929

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 4, 2023
@sonialiap
Copy link
Contributor

Taras from Margelo said they can take a look after they finish their current tasks. I've asked today for an ETA so that we can keep melvin peaceful

@melvin-bot melvin-bot bot removed the Overdue label Dec 7, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

@sonialiap @fedirjh this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:

  • Decide whether any proposals currently meet our guidelines and can be approved as-is today
  • If no proposals meet that standard, please take this issue internal and treat it as one of your highest priorities
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@melvin-bot melvin-bot bot added Internal Requires API changes or must be handled by Expensify staff and removed External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

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

@sonialiap
Copy link
Contributor

Bumped them again

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 11, 2023
@sonialiap
Copy link
Contributor

We can possibly have them take a look at this next week

@melvin-bot melvin-bot bot removed the Overdue label Dec 14, 2023
@sonialiap sonialiap added Weekly KSv2 and removed Daily KSv2 labels Dec 14, 2023
@melvin-bot melvin-bot bot added the Overdue label Dec 22, 2023
@sonialiap
Copy link
Contributor

The delay is minimal but I can still reproduce it. Bumping margelo

@melvin-bot melvin-bot bot removed the Overdue label Jan 5, 2024
@chrispader
Copy link
Contributor

chrispader commented Jan 8, 2024

Hey everyone i'm Chris from Margelo :)

Outcomes from my investigation

Just looked into this issue and i'm (only) able to reproduce it with a high-traffic account with 6x CPU throttling as suggested before, though the high-traffic doesn't seem to make any difference.

I agree with what was said before, that this is mainly caused due to a Onyx.merge (or really any big onyx operation) happening at the same time as the navigation. Both are triggered simultaneously and then the JS engine schedules the work somehow, so that it causes the navigation to lag...

I noticed this also during my work on the theme switching project, where the UI lags (on web) when you change the theme in the preferences. Imo, this is a somewhat expected effect on web-based platforms with just the JS thread doing all the work.

Possible solution

You experience this problem in many cases where we navigate at the same time as storing something to Onyx. Especially when throttling the CPU (like 6x in this case) this occurs to me on basically any other page in the settings.

Therefore i think the scope of this is way bigger than just this single flow.

As suggested before, the most straightforward solution to fix this is to just delay the navigation until after the data has been stored to Onyx.

@dylanexpensify
Copy link
Contributor

Hmm, I couldn't reproduce. I vote close

@sonialiap
Copy link
Contributor

I'm still seeing a delay, but it's not as bad in my account as in Fedi's comment #31193 (comment). Most of our ND users probably won't become high-traffic accounts so I we probably won't hear about this from them any time soon. If this is a wider behavior as suspected by Chris, then it will likely crop up in a flow that's used more than updating a merchant name and will become a higher priority for being fixed. I'm going to close this issue for now since it sounds like it requires a larger update then it's worth atm

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. Engineering Internal Requires API changes or must be handled by Expensify staff Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants