Skip to content

[Due for payment 2025-05-14] Reports-"Oops something went wrong" is displayed when navigating through contextual filters #61278

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

Open
5 of 8 tasks
mitarachim opened this issue May 1, 2025 · 25 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering 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 Reviewing Has a PR in review Weekly KSv2

Comments

@mitarachim
Copy link

mitarachim commented May 1, 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.1.39.1
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/6033034
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: iPhone 15 iOS 18.4.1 Safari, MacBook Air 15.4 Chrome
App Component: Search

Action Performed:

  1. Navigate to the staging.new.expensify.com and sign in with gmail account, that has some expenses and chats
  2. Navigate to the Reports tab/ Expenses
  3. Tap the "Outstanding", then "All" tabs on Hybrid app and mWeb, navigate through the contextual filters in Expenses on Desktop.
  4. In Reports tab open Chats and navigate through All, Unread, Drafts, Sent, Attachments and Links contextual filters.

Expected Result:

User is navigating through the contextual filters in Expenses and Chats without any errors

Actual Result:

"Uh-oh, something went wrong" is displayed when the user navigates through the different contextual filters in the Expenses and Chats tabs in Reports

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6818999_1746140797605.Recording__212.mp4

Bug6818999_1746138285372!Reports_Console.txt

Bug6818999_1746138285370.Error.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @alitoshmatov
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021919853669528528861
  • Upwork Job ID: 1919853669528528861
  • Last Price Increase: 2025-05-06
  • Automatic offers:
    • nkdengineer | Contributor | 107204027
@mitarachim mitarachim added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlocker Indicates it should block deploying the API DeployBlockerCash This issue or pull request should block deployment labels May 1, 2025
Copy link

melvin-bot bot commented May 1, 2025

Triggered auto assignment to @RachCHopkins (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 May 1, 2025

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

Copy link

melvin-bot bot commented May 1, 2025

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 1, 2025
Copy link
Contributor

github-actions bot commented May 1, 2025

👋 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.

@marcaaron
Copy link
Contributor

Seems to be throwing here:

listRef.current.scrollToIndex({index, animated, viewOffset: variables.contentHeaderHeight});

hook.js:608 Invariant Violation: scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures.

@nkdengineer
Copy link
Contributor

nkdengineer commented May 2, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-05-02 04:01:17 UTC.

Proposal

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

"Uh-oh, something went wrong" is displayed when the user navigates through the different contextual filters in the Expenses and Chats tabs in Reports

What is the root cause of that problem?

When switching between tabs, we trigger this logic:

listRef.current.scrollToIndex({index, animated, viewOffset: variables.contentHeaderHeight});

and then it throw error

hook.js:608 Invariant Violation: scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures.

I think we're calling scrollToIndex too early, and if we scroll to an index which has not been rendered, then the error will show.

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

We have some solutions:

  1. Run scrollToIndex in runAfterInteractions
InteractionManager.runAfterInteractions(()=>{
                listRef.current?.scrollToIndex({index, animated, viewOffset: variables.contentHeaderHeight});
            })
  1. We can use onScrollToIndexFailed with some delays, for example
onScrollToIndexFailed={info => {
                    const wait = new Promise(resolve => setTimeout(resolve, 500));
                    wait.then(() => {
                        listRef.current?.scrollToIndex({index: info.index, animated: true});
                    });
                  }}
  1. We can call handleSelectionListScroll in onLayout

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

None

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@marcaaron
Copy link
Contributor

What caused it?

@nkdengineer
Copy link
Contributor

@nkdengineer
Copy link
Contributor

We should trigger scroll in inLayout like we did in

const onSectionListLayout = useCallback(
(nativeEvent: LayoutChangeEvent) => {
onLayout?.(nativeEvent);
scrollToFocusedIndexOnFirstRender(nativeEvent);
},
[onLayout, scrollToFocusedIndexOnFirstRender],
);

@marcaaron
Copy link
Contributor

@martasudol @mountiny can you all chime in on the above. If it is related to that PR we should give them a change to fix it? I don't think we are in a rush to deploy on Friday.

@melvin-bot melvin-bot bot added the Overdue label May 5, 2025
@danieldoglas
Copy link
Contributor

Removing DeployBlocker tag since doesn't look to be related to backend issues.

@danieldoglas danieldoglas removed the DeployBlocker Indicates it should block deploying the API label May 5, 2025
@marcaaron
Copy link
Contributor

marcaaron commented May 5, 2025

We should probably fix this (vs. revert) since it seems relatively easy to suppress this warning for now or fix it with @nkdengineer's changes. Asking in the Slack thread to see if there are any strong feelings one way vs. another.

@melvin-bot melvin-bot bot removed the Overdue label May 5, 2025
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels May 5, 2025
@marcaaron marcaaron removed the DeployBlockerCash This issue or pull request should block deployment label May 5, 2025
@nkdengineer
Copy link
Contributor

@marcaaron I think we should call handleSelectionListScroll in onLayout, because onLayout is trigger when items are rendered. Can I work on the PR?

@marcaaron
Copy link
Contributor

Yeah I think that's fine. I haven't heard back from the PR authors/reviewers so let's do it.

@marcaaron marcaaron added the External Added to denote the issue can be worked on by a contributor label May 6, 2025
@melvin-bot melvin-bot bot changed the title [Due for payment 2025-05-13] Reports-"Oops something went wrong" is displayed when navigating through contextual filters [$250] [Due for payment 2025-05-13] Reports-"Oops something went wrong" is displayed when navigating through contextual filters May 6, 2025
Copy link

melvin-bot bot commented May 6, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 6, 2025
Copy link

melvin-bot bot commented May 6, 2025

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

@marcaaron marcaaron removed the Awaiting Payment Auto-added when associated PR is deployed to production label May 6, 2025
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 6, 2025
Copy link

melvin-bot bot commented May 6, 2025

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@marcaaron marcaaron changed the title [$250] [Due for payment 2025-05-13] Reports-"Oops something went wrong" is displayed when navigating through contextual filters Reports-"Oops something went wrong" is displayed when navigating through contextual filters May 6, 2025
@marcaaron
Copy link
Contributor

@RachCHopkins for context, I removed the Awaiting Payment label as we hot fixed this issue to unblock deploy, but the proper fix will be done by @nkdengineer

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 7, 2025
@melvin-bot melvin-bot bot changed the title Reports-"Oops something went wrong" is displayed when navigating through contextual filters [Due for payment 2025-05-14] Reports-"Oops something went wrong" is displayed when navigating through contextual filters May 7, 2025
Copy link

melvin-bot bot commented May 7, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.40-7 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-05-14. 🎊

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

Copy link

melvin-bot bot commented May 7, 2025

@alitoshmatov @RachCHopkins @alitoshmatov 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]

@RachCHopkins RachCHopkins added Daily KSv2 and removed Awaiting Payment Auto-added when associated PR is deployed to production Weekly KSv2 labels May 7, 2025
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 7, 2025
@alitoshmatov
Copy link
Contributor

Please unassign me, I didn't participate in this issue.

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 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 Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants