Skip to content

[Due for payment 2025-04-14] [$250] Search - Tapping an item from recent list directs blank page in mWeb & LHN in Android briefly #57293

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

Closed
3 of 8 tasks
IuliiaHerets opened this issue Feb 22, 2025 · 51 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Feb 22, 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: V9.1.4-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
Issue reported by: Applause Internal Team
Device used: Redmi note 10s android 13
App Component: Search

Action Performed:

  1. Launch app in both mweb and android
  2. Tap search icon
  3. Tap on an item from the recent list

Expected Result:

Tapping an item from recent list must directs to that particular page.

Actual Result:

In mweb, tapping on an item from recent list directs to blank page briefly before showing the particular item but in android LHN is shown briefly. Both android and mweb shows inconsistent behaviour.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6750867_1740232548765.Screenrecorder-2025-02-22-19-17-58-29.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021893993559253605030
  • Upwork Job ID: 1893993559253605030
  • Last Price Increase: 2025-03-03
  • Automatic offers:
    • DylanDylann | Reviewer | 106425059
    • daledah | Contributor | 106425060
Issue OwnerCurrent Issue Owner: @trjExpensify
@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Feb 22, 2025
Copy link

melvin-bot bot commented Feb 22, 2025

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Feb 22, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-02-22 20:48:36 UTC.

Proposal

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

Search - Tapping an item from recent list directs blank page in mWeb & LHN in Android briefly

What is the root cause of that problem?

  • When shouldUseNarrowLayout is true, we set the modal type to CENTERED_SWIPABLE_TO_RIGHT. This modal type is considered a fullscreen modal, so hasBackdrop will be true.
    const modalType = shouldUseNarrowLayout ? CONST.MODAL.MODAL_TYPE.CENTERED_SWIPABLE_TO_RIGHT : CONST.MODAL.MODAL_TYPE.POPOVER;

    hasBackdrop={fullscreen}
  • We only set the backdrop opacity to false when !shouldUseCustomBackdrop && hideBackdrop is true. However, in this case, hideBackdrop is false because it is only true for popovers.
    backdropOpacity={!shouldUseCustomBackdrop && hideBackdrop ? 0 : variables.overlayOpacity}
  • As a result, when the modal is closed, the backdrop remains visible with some opacity, making it appear like a blank page.

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

  • We need to override the backdropOpacity or hasBackdrop prop, or possibly both. This can be achieved by extracting these props, passed to the BaseModal component and then pass it to backdropOpacity & hasBackdrop props.
backdropOpacity={!shouldUseCustomBackdrop && hideBackdrop ? 0 : backdropOpacity ?? variables.overlayOpacity}
hasBackdrop={hasBackdrop ?? fullscreen}
  • And then pass backdropOpacity={0} & hasBackdrop={false} from SearchRouterModal.
  • Additionally, we also need to wrap the navigation within setNavigationActionToMicrotaskQueue, this is because the modal requires time to finish it's animation, otherwise the blank screen will be shown.
    onRouterClose();
    Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query: updatedQuery}));

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

N/A -- UI Issue

What alternative solutions did you explore? (Optional)

N/A

@Krishna2323
Copy link
Contributor

PROPOSAL UPDATED

@daledah
Copy link
Contributor

daledah commented Feb 23, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-03-05 18:23:04 UTC.

Proposal

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

  • In mweb, tapping on an item from recent list directs to blank page briefly before showing the particular item but in android LHN is shown briefly. Both android and mweb shows inconsistent behaviour.

What is the root cause of that problem?

  • When selecting an item from the search route modal, it triggers onRouterClose:


onRouterClose={closeSearchRouter}

This sets isSearchRouterDisplayed to false before navigating to the target report screen:

Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(item?.reportID));

  • During the brief moment between isSearchRouterDisplayed being set to false and the navigation occurring, an empty screen appears. This happens because the search route content is only displayed when isSearchRouterDisplayed is true:
    {isSearchRouterDisplayed && (
    <FocusTrapForModal active={isSearchRouterDisplayed}>
    <SearchRouter
    onRouterClose={closeSearchRouter}
    shouldHideInputCaret={shouldHideInputCaret}
    />
    </FocusTrapForModal>
    )}

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

  • Removing the condition isSearchRouterDisplayed in:

can fix the blank page issue.

  • Now, the LHN briefly appears on both platforms when tapping an item. This happens due to the gap between closing the modal and displaying the target report.
  • To minimize this delay, we can update:

onRouterClose();
KeyboardUtils.dismiss().then(() => {
if (item?.reportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(item?.reportID));
} else if ('login' in item) {
navigateToAndOpenReport(item.login ? [item.login] : [], false);
}
});

                if (item?.reportID) {
                    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(item?.reportID));
                } else if ('login' in item) {
                    navigateToAndOpenReport(item.login ? [item.login] : [], false);
                }
                InteractionManager.runAfterInteractions(() => { // Can use `setTimeout` with a delay time is 0 instead.
                    onRouterClose();
                });
  • In this code changes:
  1. I remove the KeyboardUtils.dismiss() block (optional).
  2. Call onRouterClose(); when it navigates to the report screen (optional).
  • For the bug:

After applying the above change, I see a minor bug: The "Search in ..." text with the search icon displays before navigating

We can add:

            if (!isSearchRouterDisplayed) {
                return undefined;
            }

in:

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)

Result

https://github.com/user-attachments/assets/82df52c2-9a99-4cf9-9a0f-9bf70002226c8

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label Feb 24, 2025
Copy link

melvin-bot bot commented Feb 24, 2025

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

@melvin-bot melvin-bot bot changed the title Search - Tapping an item from recent list directs blank page in mWeb & LHN in Android briefly [$250] Search - Tapping an item from recent list directs blank page in mWeb & LHN in Android briefly Feb 24, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 24, 2025
Copy link

melvin-bot bot commented Feb 24, 2025

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

@trjExpensify trjExpensify moved this to Bugs and Follow Up Issues in #expensify-bugs Feb 24, 2025
@trjExpensify
Copy link
Contributor

CC: @luacmartins for vis 👀

@luacmartins luacmartins self-assigned this Feb 24, 2025
@DylanDylann
Copy link
Contributor

Hi contributors, could you guys provide videos on mWeb and Android after applying your solutions?

@Krishna2323
Copy link
Contributor

@DylanDylann, here's the video. In the video, you can also see that the behavior is consistent with the start chat flow.

Monosnap.screencast.2025-02-27.11-09-17.mp4

@daledah
Copy link
Contributor

daledah commented Feb 27, 2025

Proposal updated

  • I just added result video.

@DylanDylann
Copy link
Contributor

@daledah Thanks for your proposal. First, I think we should move isSearchRouterDisplayed check to outside instead of removing it

return isSearchRouterDisplayed && (
        <Modal
            type={modalType}
            isVisible={isSearchRouterDisplayed}
            innerContainerStyle={{paddingTop: safeAreaInsets.top + viewportOffsetTop}}
......

And we shouldn't remove the dismiss function

                KeyboardUtils.dismiss().then(() => {
                    if (item?.reportID) {
                        Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(item?.reportID));
                    } else if ('login' in item) {
                        navigateToAndOpenReport(item.login ? [item.login] : [], false);
                    }
                });
                InteractionManager.runAfterInteractions(() => { 
                    onRouterClose();
                });

After applying the above change, I see a minor bug: The "Search in ..." text with the search icon displays before navigating

Screen.Recording.2025-03-03.at.12.31.52.mov

@DylanDylann
Copy link
Contributor

DylanDylann commented Mar 3, 2025

@Krishna2323 Thanks for your proposal. But I prefer @daledah's solution because it solves this problem completely

Copy link

melvin-bot bot commented Mar 3, 2025

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

@Krishna2323
Copy link
Contributor

@DylanDylann Thanks for the review. Can you please explain what's missing in my proposal?

@melvin-bot melvin-bot bot added the Overdue label Mar 5, 2025
@daledah
Copy link
Contributor

daledah commented Mar 5, 2025

@DylanDylann I updated the proposal to fix the issue you mentioned in comment.

Copy link

melvin-bot bot commented Mar 6, 2025

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

@DylanDylann
Copy link
Contributor

@daledah's proposal looks good to me

🎀 👀 🎀 C+ Reviewed

@melvin-bot melvin-bot bot removed the Overdue label Mar 7, 2025
@DylanDylann
Copy link
Contributor

DylanDylann commented Mar 7, 2025

@DylanDylann Thanks for the review. Can you please explain what's missing in my proposal?

@Krishna2323 Your proposal also can solve this problem, but I lean toward @daledah's proposal

@daledah
Copy link
Contributor

daledah commented Mar 21, 2025

@DylanDylann PR is ready.

@trjExpensify
Copy link
Contributor

Checklist time for tomorrow, @DylanDylann.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 27, 2025
@trjExpensify
Copy link
Contributor

Bump on the checklist! =D

@DylanDylann
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment:

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@DylanDylann
Copy link
Contributor

The PR is still being reviewed. The previous PR was reverted

@trjExpensify trjExpensify changed the title [Due for payment 2025-03-27] [$250] Search - Tapping an item from recent list directs blank page in mWeb & LHN in Android briefly [$250] Search - Tapping an item from recent list directs blank page in mWeb & LHN in Android briefly Apr 2, 2025
@trjExpensify trjExpensify removed the Awaiting Payment Auto-added when associated PR is deployed to production label Apr 2, 2025
@trjExpensify
Copy link
Contributor

Removed the payment holds.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Apr 7, 2025
@melvin-bot melvin-bot bot changed the title [$250] Search - Tapping an item from recent list directs blank page in mWeb & LHN in Android briefly [Due for payment 2025-04-14] [$250] Search - Tapping an item from recent list directs blank page in mWeb & LHN in Android briefly Apr 7, 2025
Copy link

melvin-bot bot commented Apr 7, 2025

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 7, 2025
Copy link

melvin-bot bot commented Apr 7, 2025

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

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

Copy link

melvin-bot bot commented Apr 7, 2025

@DylanDylann @trjExpensify @DylanDylann 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 Apr 14, 2025
@trjExpensify
Copy link
Contributor

trjExpensify commented Apr 15, 2025

👋 Alright, payment summary as follows:

@DylanDylann
Copy link
Contributor

There was one regression it seems

@trjExpensify I would like to say no because the second PR is the same as the previous PR. The regression seems not to be from our change and it seems a mistake elsewhere

@DylanDylann
Copy link
Contributor

cc @daledah @luacmartins

@trjExpensify
Copy link
Contributor

Hm, I'm confused. 😕

#58878 - why does this PR title say "and fix regressions" and tags the blockers that were created causing us to revert it? Where else were they fixed, if not in this PR. 🤔

Comment ref:

@daledah @DylanDylann we reverted this PR because it caused two blockers. @daledah please work on a new PR taking those into account:

#58726
#58742

@DylanDylann
Copy link
Contributor

DylanDylann commented Apr 15, 2025

@daledah please update the title of the second PR. To be honest, we didn't change anything and didn't fix any regression

@trjExpensify
Copy link
Contributor

Where were those bugs fixed then? 😅

@daledah
Copy link
Contributor

daledah commented Apr 15, 2025

Initially we thought that the deploy blockers was from the original PR. But after opening the second PR, I could not reproduce the deploy blockers anymore with code changes from the PR above, so I mentioned it here and reverted the additional changes in this PR.

Basically the second PR reimplements the first PR and regression comes from another PR and is fixed now.

@trjExpensify
Copy link
Contributor

Interesting, okay. Edited the payment summary to $250. Paid and closing!

@github-project-automation github-project-automation bot moved this from Bugs and Follow Up Issues to Done in #expensify-bugs Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests

6 participants