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

[UX Reliability] HIGH: Investigate and fix using multiple GetMissingOnyxMessages and ReconnectApp calls to load all Onyx data #42136

Closed
1 of 6 tasks
muttmuure opened this issue May 14, 2024 · 28 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@muttmuure
Copy link
Contributor

muttmuure commented May 14, 2024

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


What performance issue do we need to solve?

e.g. memory consumption, storage read/write times, React native bridge concerns, inefficient React component rendering, etc.

When you haven't visited a chat for a while, we run GetMissingOnyxMessages (twice) then ReconnectApp twice. We are loading all Onyx data multiple times before showing it to the end user.

When you have not used the app in a while (I just switched from staging to prod and had not used prod in a while) this happens:

  1. We call one API command, which returns Your session has expired. Please sign in again (makes sense since I have not used it in a while)
  2. We call Authenticate
  3. We call UpdateAutomaticTimezone (I assume since I am on a different timezone than list time)
  4. It detects I have lots of missing onyx messages and calls GetMissingOnyxMessages this internally triggers a full load, since we don't have that many onyx messages saved
  5. (this is the problem I think) It calls ReconnectApp which returns again the same full response as the previous call)

What is the impact of this on end-users?

List specific user experiences that will be improved by solving this problem e.g. app boot time, time to for some interaction to complete, etc.

This series of operations creates additional work for the client, when all the end user wants is for the app to:

  • Load all messages efficiently
  • Render them

Whereas right now the additional "loading" operations mean that there is a delay to these events taking place.

List any benchmarks that show the severity of the issue

Please also provide exact steps taken to collect metrics above if any so we can independently verify the results.

I've started a discussion in #newdot-quality here

Proposed solution (if any)

Please list out the steps you think we should take to solve this issue.

We need to investigate why there are these redundant ReconnectApp and GetMissingOnyxMessages calls, and make sure that we can load all missing data in one performant call.

List any benchmarks after implementing the changes to show impacts of the proposed solution (if any)

Note: These should be the same as the benchmarks collected before any changes.

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

Version Number: v1.4.73-3
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by: @muttmuure
Slack conversation: https://expensify.slack.com/archives/C05LX9D6E07/p1715611536548199

View all open jobs on Upwork

Copy link

melvin-bot bot commented May 14, 2024

Auto-assigning issues to engineers is no longer supported. If you think this issue should receive engineering attention, please raise it in #whatsnext.

@muttmuure muttmuure changed the title [Performance] Investigate and fix using multiple GetMissingOnyxMessages and ReconnectApp calls to load all Onyx data [UX Reliability] HIGH: Investigate and fix using multiple GetMissingOnyxMessages and ReconnectApp calls to load all Onyx data May 14, 2024
@muttmuure muttmuure added the Bug Something is broken. Auto assigns a BugZero manager. label May 14, 2024
Copy link

melvin-bot bot commented May 14, 2024

Triggered auto assignment to @MitchExpensify (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 melvin-bot bot added the Overdue label May 16, 2024
Copy link

melvin-bot bot commented May 17, 2024

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

@MitchExpensify
Copy link
Contributor

@muttmuure is there an SO for how to process these from a BZ standpoint? I'm not seeing one 👀

@melvin-bot melvin-bot bot removed the Overdue label May 19, 2024
@muttmuure

This comment was marked as off-topic.

@github-project-automation github-project-automation bot moved this from HIGH to Done in [#whatsnext] #quality May 20, 2024
@muttmuure muttmuure reopened this May 20, 2024
@muttmuure muttmuure moved this from Done to HIGH in [#whatsnext] #quality May 20, 2024
@muttmuure
Copy link
Contributor Author

@gedu since you fixed ReconnectApp in that issue I linked above, could you investigate this one and tidy up these redundant ReconnectApp calls when you've not visited the site in a while?

@melvin-bot melvin-bot bot added the Overdue label May 22, 2024
Copy link

melvin-bot bot commented May 23, 2024

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

@MitchExpensify
Copy link
Contributor

Friendly bump on the above @gedu

@melvin-bot melvin-bot bot removed the Overdue label May 26, 2024
@gedu
Copy link
Contributor

gedu commented May 27, 2024

@gedu since you fixed ReconnectApp in that issue I linked above, could you investigate this one and tidy up these redundant ReconnectApp calls when you've not visited the site in a while?

Sorry, it seems I missed this message, yes, I can take a look, @muttmuure do you have any reproduction steps? what does "not visited in a while" mean? (how long)

@gedu
Copy link
Contributor

gedu commented May 28, 2024

I think I could reproduce it, seems that it keeps to make some requests, and because it isn't connected to internet, it enqueues the requests and when you get back online it starts sending them.

Looking into it, but could be Pusher, it tries to connect to some channel and it has a callback that it is reconnect onPusherResubscribeToPrivateUserChannel trying to confirm this and think on a solution

Screenshot 2024-05-28 at 09 00 15

Copy link

melvin-bot bot commented May 28, 2024

@MitchExpensify 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!

Copy link

melvin-bot bot commented May 29, 2024

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

@melvin-bot melvin-bot bot added the Overdue label May 29, 2024
Copy link

melvin-bot bot commented May 30, 2024

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

@gedu
Copy link
Contributor

gedu commented May 31, 2024

It is getting hard to reproduce it, I'm trying different ways to reproduce it. Would be really helpful if someone can help me on getting some steps, so if I find the fix I can make sure it is solved.
Can we move it to weekly?

@MitchExpensify
Copy link
Contributor

@muttmuure do you have any reproduction steps?

Any help here is appreciated, @muttmuure 🙇

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jun 2, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

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

@gedu
Copy link
Contributor

gedu commented Jun 7, 2024

No news here, trying to reproduce, I think the bugs is related with SequenceQueue process not running. NetInfo is trying to reconnect when it "detects" there is an internet connection so is trying to do fetch ReconnectApp with Policies but the request never fired, so it get into the queue

Copy link

melvin-bot bot commented Jun 10, 2024

@MitchExpensify Still overdue 6 days?! Let's take care of this!

@MitchExpensify
Copy link
Contributor

I'm a little lost on this one @muttmuure, do you have any recs on how to move it along?

@melvin-bot melvin-bot bot removed the Overdue label Jun 11, 2024
@gedu
Copy link
Contributor

gedu commented Jun 13, 2024

I'm looking into other Critical bugs, I will keep trying to look into this soon

@melvin-bot melvin-bot bot added the Overdue label Jun 13, 2024
@gedu
Copy link
Contributor

gedu commented Jun 13, 2024

Seems to come from this commit: cd7ba79

and PR: #32548

so we have to use .website or make the changes I mention

Copy link

melvin-bot bot commented Jun 14, 2024

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

@MitchExpensify
Copy link
Contributor

Just to be sure, do you have a proposal for a fix @gedu ?

@melvin-bot melvin-bot bot removed the Overdue label Jun 18, 2024
@gedu
Copy link
Contributor

gedu commented Jun 18, 2024

Sorry my previous comment was for another issues, I'm looking into 2 critical ones, and as soon as I finish them I will keep looking here. Is this still a thing? is still happening?

@MitchExpensify
Copy link
Contributor

@muttmuure, Sorry, I'm a bit lost on this one. Do we still need this fixed?

@muttmuure
Copy link
Contributor Author

Damn I keep missing this. I think this is resolved

@muttmuure
Copy link
Contributor Author

Sorry!

@MitchExpensify
Copy link
Contributor

hah no worries, I'll close based on that!

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. Daily KSv2 Engineering
Projects
Status: Done
Development

No branches or pull requests

3 participants