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

[$250] Expense-App shows not here page instead of auto refresh report when exchanging expense offline #54512

Open
6 of 8 tasks
IuliiaHerets opened this issue Dec 24, 2024 · 26 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Overdue

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-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5366083
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.0 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • User A and User B have never chatted before.
  1. Go to staging.new.expensify.com
  2. [User A] Go offline.
  3. [User A] Submit an expense to User B
  4. [User B] While online, submit an expense to User A
  5. [User A] Stay on chat with User B and go online.

Expected Result:

App will auto refresh not here page and show the chat with User B to User A (production behavior).

Actual Result:

App does not auto refresh not here page and stays on not here page instead of showing chat to User A.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6701627_1735013893300.20241224_121049.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021871573534175728926
  • Upwork Job ID: 1871573534175728926
  • Last Price Increase: 2024-12-24
  • Automatic offers:
    • DylanDylann | Reviewer | 105455988
Issue OwnerCurrent Issue Owner: @DylanDylann
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment 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 @anmurali (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 Dec 24, 2024

Triggered auto assignment to @carlosmiceli (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 24, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@carlosmiceli carlosmiceli 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-App shows not here page instead of auto refresh report when exchanging expense offline [$250] Expense-App shows not here page instead of auto refresh report when exchanging expense offline Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

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

@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 - @DylanDylann (External)

@pasyukevich
Copy link
Contributor

Hi, I'm Eugene from Callstack - expert contributor group. I’d like to work on this issue.

@melvin-bot melvin-bot bot removed 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

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@carlosmiceli carlosmiceli added Daily KSv2 and removed Hourly KSv2 labels Dec 24, 2024
@pasyukevich
Copy link
Contributor

I was able to reproduce the issue.

I also noticed that the app is going in cycled request sending. It looks like it rejects the update and sends it again this causes the app stuck

I will continue my investigation by identifying the root cause

The next two days will be on the Christmas holidays, I will continue my investigation on Friday

@jasperhuangg jasperhuangg added the DeployBlocker Indicates it should block deploying the API label Dec 24, 2024
@jasperhuangg
Copy link
Contributor

This feels pretty edge-casey, in the interest of not blocking deploys I'm going to remove the label.

@jasperhuangg jasperhuangg removed DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Dec 24, 2024
@carlosmiceli carlosmiceli added Weekly KSv2 and removed Daily KSv2 labels Dec 24, 2024
@pasyukevich
Copy link
Contributor

Today's update:

continue my search for the root cause

@pasyukevich
Copy link
Contributor

Today's update:

Still looking for the root cause, focused mainly on the shouldShowNotFoundPage and fetchReportIfNeeded.

Looks like it is coming from them

@pasyukevich
Copy link
Contributor

Today's update:

After debugging, I identified that the issue came from Onyx updates.
1. When an open report response is received, the correct report ID is retrieved (created by another user online).
2. Following this, the URL and page are accordingly updated.
3. API provides correct data for the new report
3. In Onyx data is saved for a new report that only includes the error field from the previous report.

I will continue my investigation.

image image

@melvin-bot melvin-bot bot added the Overdue label Jan 3, 2025
Copy link

melvin-bot bot commented Jan 7, 2025

@carlosmiceli @anmurali @pasyukevich @DylanDylann this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@DylanDylann
Copy link
Contributor

@pasyukevich Any update on it?

@melvin-bot melvin-bot bot removed the Overdue label Jan 7, 2025
@pasyukevich
Copy link
Contributor

No updates here

I'm investigating the issue from Onyx's side

@fabioh8010
Copy link
Contributor

Updates:

  • Spent the day investigating this issue trying to help Eugene, was able to reproduce it even on Production, I captured some logs and API requests/responses but didn't find the root cause yet.

@pasyukevich
Copy link
Contributor

Updates:

  • Locating the version of the app where there was no such issue to check the difference code

@pasyukevich
Copy link
Contributor

Updates:

  • Checking over the differences in the code to locate the exact changes that led to the issue

@pasyukevich
Copy link
Contributor

Updates:

  • I found the root cause and am now focused on the fix

@melvin-bot melvin-bot bot added the Overdue label Jan 15, 2025
@carlosmiceli
Copy link
Contributor

Not overdue Melv ☝

@carlosmiceli carlosmiceli added Weekly KSv2 and removed Weekly KSv2 labels Jan 15, 2025
@melvin-bot melvin-bot bot removed the Overdue label Jan 15, 2025
@pasyukevich
Copy link
Contributor

Updates:

  • Preparing the proposal

@pasyukevich
Copy link
Contributor

pasyukevich commented Jan 20, 2025

Proposal

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

The issue arises when the app operates offline, and a report is created. If another user creates a new report for the same user during this time, the app does not sync correctly when it comes back online. This results in inconsistencies in report data.

What is the root cause of that problem?

The root cause lies within the fetchReportIfNeeded method. Specifically, the issue is triggered by the inclusion of reportMetadata in the dependency array. This causes unintended behavior when evaluating whether a report needs to be fetched.

Currently, reportMetadata object triggers an update of the fetchReportIfNeeded method that triggers the useEffect with this method that makes an API call. The infinity chain of the calls prevents report updates.

Attaching the screenshot that demonstrates report calls in one minute (console.log inside of the useEffect that calls fetchReportIfNeeded).

Image

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

To address this problem, we need to update the shouldFetchReport method used in fetchReportIfNeeded. Instead of passing the entire reportMetadata object, the method should be updated to accept a simple boolean variable - isOptimisticReport that we use inside the method, avoiding the complications caused by passing and monitoring a complex object.

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

Does not apply

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 20, 2025
Copy link
Contributor

⚠️ @pasyukevich Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

Copy link

melvin-bot bot commented Jan 21, 2025

@carlosmiceli @anmurali @pasyukevich @DylanDylann this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Jan 21, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

@carlosmiceli, @anmurali, @pasyukevich, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Jan 24, 2025
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 External Added to denote the issue can be worked on by a contributor Overdue
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

7 participants