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 2025-02-04] Frequent Client Hanging and Loss of Workspace List #54802

Closed
1 of 8 tasks
m-natarajan opened this issue Jan 5, 2025 · 34 comments
Closed
1 of 8 tasks
Assignees
Labels
AutoAssignerNewDotQuality Used to assign quality issues to engineers Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Jan 5, 2025

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.80-6
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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: @quinthar
Slack conversation (hyperlinked to channel name): quality

Action Performed:

  1. Use the application normally throughout the day.
  2. Observe that at random intervals, the app hangs, and the workspace list disappears.
  3. Attempt to load any data (reads) — operations fail.
  4. Attempt to send a message (write) — operation succeeds.

Expected Result:

The application should function continuously without frequent hanging. Both "read" and "write" operations should work as expected without requiring manual refreshes.

Actual Result:

The app frequently hangs, causing loss of the workspace list and failure of "read" operations, while "write" operations continue to work.

Workaround:

Refresh the application to temporarily resolve the issue.

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

image (6)

image (7)

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @joekaufmanexpensify
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. AutoAssignerNewDotQuality Used to assign quality issues to engineers labels Jan 5, 2025
Copy link

melvin-bot bot commented Jan 5, 2025

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

Copy link

melvin-bot bot commented Jan 5, 2025

Triggered auto assignment to @rafecolton (AutoAssignerNewDotQuality)

@melvin-bot melvin-bot bot added the Weekly KSv2 label Jan 5, 2025
@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@joekaufmanexpensify
Copy link
Contributor

Will take a look today

@joekaufmanexpensify
Copy link
Contributor

Hmm, I am not personally having the issues described in OP in my account. Seems like maybe this could be an issue with David's account specifically, which I'm sure has many more historical reports in it than mine.

I feel like this might be one where having David share some of the performance data related to his account when he experiences this issue could be a good next step. But curious what you think @rafecolton?

@rafecolton
Copy link
Member

rafecolton commented Jan 6, 2025

If we think it's specific to David's account, let's see if he's still experiencing it daily with the latest version. If so, perhaps he can work an external contributor to debug it and/or share performance data whenever it happens next?

@joekaufmanexpensify
Copy link
Contributor

Sounds good, asked here!

@muttmuure
Copy link
Contributor

Agree it would be good to get a profile trace and then we can see the root cause of the UI hang

@muttmuure muttmuure moved this to CRITICAL in [#whatsnext] #quality Jan 7, 2025
@joekaufmanexpensify
Copy link
Contributor

Bumped David to share the troubleshooting info Callstack requested

@rafecolton
Copy link
Member

I am no longer doing the newdot quality chore and need to reassign this issue to focus on SOX and PCI

@rafecolton rafecolton removed their assignment Jan 10, 2025
@rafecolton rafecolton added AutoAssignerNewDotQuality Used to assign quality issues to engineers and removed AutoAssignerNewDotQuality Used to assign quality issues to engineers labels Jan 10, 2025
Copy link

melvin-bot bot commented Jan 10, 2025

Triggered auto assignment to @carlosmiceli (AutoAssignerNewDotQuality)

@melvin-bot melvin-bot bot added the Weekly KSv2 label Jan 10, 2025
@rafecolton rafecolton removed the Weekly KSv2 label Jan 10, 2025
@joekaufmanexpensify
Copy link
Contributor

We are discussing this further here

@melvin-bot melvin-bot bot added the Overdue label Jan 13, 2025
@TMisiukiewicz
Copy link
Contributor

TMisiukiewicz commented Jan 13, 2025

Hey, Tomasz from Callstack here.

I started investigating it based on David's exported Onyx state. I haven't experienced workspace list disappearance yet, but based on the state, I was able to reproduce app freezes when switching between the chats. This is mainly because we are using getOrderedReportIDs function inside a function responsible for calculating whether display RBR or GBR in the UI. We identified this function as performance bottleneck a couple of months ago already. Instead of calling it directly to determine RBR/GBR visibility, I tried passing its output from the context. It seems to be working fine, but it needs a bit more testing. Thanks to that, getOrderedReportIDs is not called excessively when switching between chats.

Trace before:

Image

getOrderedReportIds calls took 8s when switching between chats

After my changes, it is not called at all and switch between chats happen immediately. As i said before, it still needs a bit more testing and also verifying if it fixes core issue with the loss of workspace list.

I'll give you another update tomorrow.

@TMisiukiewicz
Copy link
Contributor

TMisiukiewicz commented Jan 22, 2025

Hey, while working on this one I have found one more performance improvement related to the workspace list and switching workspaces

Background

Switching between workspaces on large accounts is noticeably slow, causing delays in the user experience.

Problem

Every time a workspace is switched, the app processes all reports, running them through several functions to determine if they should appear in the LHN. This approach is inefficient, especially for accounts with a large number of reports, as it performs unnecessary computations on reports that don’t belong to the current workspace.

Solution

Optimize the getOrderedReportIDs function by applying an initial filter to include only reports associated with the current workspace (currentPolicyID). This reduces the number of reports processed by downstream functions that decide LHN visibility. This change reduces computational overhead, cutting execution time on Android from ~1.5 seconds to ~500 milliseconds in tests using David’s Onyx state.

@carlosmiceli
Copy link
Contributor

@TMisiukiewicz great extra find!

@rayane-d
Copy link
Contributor

Copy link

melvin-bot bot commented Jan 23, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@joekaufmanexpensify
Copy link
Contributor

PR on staging

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 28, 2025
@melvin-bot melvin-bot bot changed the title Frequent Client Hanging and Loss of Workspace List [HOLD for payment 2025-02-04] Frequent Client Hanging and Loss of Workspace List Jan 28, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 28, 2025
Copy link

melvin-bot bot commented Jan 28, 2025

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

Copy link

melvin-bot bot commented Jan 28, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 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-04. 🎊

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

Copy link

melvin-bot bot commented Jan 28, 2025

@rayane-djouah @joekaufmanexpensify @rayane-djouah 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 3, 2025
@joekaufmanexpensify
Copy link
Contributor

Assigned @sobitneupane because you reviewed #55604

@joekaufmanexpensify
Copy link
Contributor

This is an interesting one. There are 3 separate PRs here. One reviewed by @sobitneupane and two by @rayane-d.

@rayane-d I am thinking that $250 is fair for yours because though there were two, one had a regression. LMK if any concerns with that!

@joekaufmanexpensify
Copy link
Contributor

Otherwise, all set to issue payment. We need to pay:

@joekaufmanexpensify
Copy link
Contributor

Please request payment at your earliest convenience. Going to close this as it's otherwise all set!

@rayane-d
Copy link
Contributor

rayane-d commented Feb 4, 2025

Requested in NewDot

Copy link

melvin-bot bot commented Feb 4, 2025

📣 @rayane-d! 📣
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>

@garrettmknight
Copy link
Contributor

$250 approved for @rayane-d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoAssignerNewDotQuality Used to assign quality issues to engineers Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
Status: Done
Development

No branches or pull requests