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 2024-06-28] [$250] [Search v1] iOS - Search - Background behind the transaction thread is blank when swiping to right #43478

Closed
1 of 6 tasks
izarutskaya opened this issue Jun 11, 2024 · 20 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Jun 11, 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: v1.4.81-8
Reproducible in staging?: Y
Reproducible in production?: New feature
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Launch New Expensify app.
  2. Go to Search.
  3. Open any transaction.
  4. Swipe the page to the right and do not release the finger.

Expected Result:

The background behind the transaction thread will show Search page.

Actual Result:

The background behind the transaction thread is blank.

Workaround:

Unknown

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

Screenshots/Videos

Bug6509255_1718104435100.RPReplay_Final1718104258.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014f3e060c40c4a8f2
  • Upwork Job ID: 1800531818313064614
  • Last Price Increase: 2024-06-11
  • Automatic offers:
    • eh2077 | Reviewer | 102704810
    • bernhardoj | Contributor | 102704811
Issue OwnerCurrent Issue Owner: @puneetlath
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

Copy link

melvin-bot bot commented Jun 11, 2024

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

@izarutskaya
Copy link
Author

@puneetlath I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@izarutskaya
Copy link
Author

We think this issue might be related to the #collect project.

@luacmartins luacmartins removed the DeployBlocker Indicates it should block deploying the API label Jun 11, 2024
@luacmartins
Copy link
Contributor

I don't think this needs to be a blocker since the feature works and it's a minor UI issue.

@luacmartins luacmartins added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jun 11, 2024
@luacmartins luacmartins self-assigned this Jun 11, 2024
@luacmartins luacmartins added the External Added to denote the issue can be worked on by a contributor label Jun 11, 2024
@melvin-bot melvin-bot bot changed the title iOS - Search - Background behind the transaction thread is blank when swiping to right [$250] iOS - Search - Background behind the transaction thread is blank when swiping to right Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

@luacmartins luacmartins changed the title [$250] iOS - Search - Background behind the transaction thread is blank when swiping to right [$250] [Search v1] iOS - Search - Background behind the transaction thread is blank when swiping to right Jun 11, 2024
@bernhardoj
Copy link
Contributor

Proposal

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

The background is blank when swiping to close the report RHP.

What is the root cause of that problem?

When we go to the search page, we add both search bottom tab and search central pane. (both have the same url)

<Tooltip text={translate('common.search')}>
<PressableWithFeedback
onPress={() => {
interceptAnonymousUser(() => Navigation.navigate(ROUTES.SEARCH.getRoute(CONST.TAB_SEARCH.ALL)));
}}

In small screen, we only want to show the search bottom tab, so, to hide the central pane in small screen, we have a custom navigation state logic to hide the search central pane.

// On narrow layout, if we are on /search route we want to hide all central pane routes and show only the bottom tab navigator.
if (isSmallScreenWidth && isLastRouteSearchRoute) {
return {
stateToRender: {
...state,
index: 0,
routes: [firstRoute],
},
searchRoute: lastRoute,
};
}

One condition that we need to focus is isLastRouteSearchRoute. It checks whether the last route is the search central pane or not.

const isLastRouteSearchRoute = getTopmostCentralPaneRoute({routes: [lastRoute]} as State<RootStackParamList>)?.name === SCREENS.SEARCH.CENTRAL_PANE;

However, when we open the report/transaction RHP (or any page), the last route is not search central pane anymore, but the report RHP, thus the search central pane is not hidden anymore. When we swipe to right from the report RHP, the blank screen is the search central pane. Why blank?

It's because we return null if it's a small screen.

// On small screens this page is not displayed, the configuration is in the file: src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.tsx
// To avoid calling hooks in the Search component when this page isn't visible, we return null here.
if (isSmallScreenWidth) {
return null;
}

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

Always filter out the search central pane from the navigation state to render.

if (isSmallScreenWidth) {
    const searchCentralPaneIndex = routes.findIndex(route => route.name === 'CentralPaneNavigator' && route.params && 'screen' in route.params && route.params.screen === SCREENS.SEARCH.CENTRAL_PANE);
    const filteredRoutes = [...routes.slice(0, searchCentralPaneIndex), ...routes.slice(searchCentralPaneIndex + 1)];
    return {
        stateToRender: {
            ...state,
            index: filteredRoutes.length - 1,
            routes: filteredRoutes,
        },
        searchRoute: routes[searchCentralPaneIndex],
    };
}

@luacmartins
Copy link
Contributor

The RCA and solution make sense to me. Maybe we could use a .filter to make the code a bit cleaner though. Otherwise looks good.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 12, 2024
Copy link

melvin-bot bot commented Jun 12, 2024

📣 @eh2077 🎉 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

Copy link

melvin-bot bot commented Jun 12, 2024

📣 @bernhardoj 🎉 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jun 13, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @eh2077

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 21, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Search v1] iOS - Search - Background behind the transaction thread is blank when swiping to right [HOLD for payment 2024-06-28] [$250] [Search v1] iOS - Search - Background behind the transaction thread is blank when swiping to right Jun 21, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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

Copy link

melvin-bot bot commented Jun 21, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.85-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 2024-06-28. 🎊

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

Copy link

melvin-bot bot commented Jun 21, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@eh2077] The PR that introduced the bug has been identified. Link to the PR:
  • [@eh2077] 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:
  • [@eh2077] A discussion in #expensify-bugs 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:
  • [@eh2077] Determine if we should create a regression test for this bug.
  • [@eh2077] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 27, 2024
@puneetlath
Copy link
Contributor

@bernhardoj has been paid. @eh2077 bump on the checklist so we can pay you.

@melvin-bot melvin-bot bot added the Overdue label Jul 1, 2024
@eh2077
Copy link
Contributor

eh2077 commented Jul 1, 2024

Checklist

  • [@eh2077] The PR that introduced the bug has been identified. Link to the PR: I don't think there's a specific PR responsible for this issue. It's an edge case that wan't covered by app-navigation
  • [@eh2077] 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: N/A
  • [@eh2077] A discussion in #expensify-bugs 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: N/A
  • [@eh2077] Determine if we should create a regression test for this bug. Yes

Regression test

  1. Open search page
  2. Open any report
  3. Verify the transaction screen opens
  4. (iOS/mWeb iOS) Swipe right and don't release the finger (Android/Android mWeb) Press back button
  5. Verify you can see the search page list under the transaction screen

Do we agree 👍 or 👎

cc @puneetlath

@puneetlath
Copy link
Contributor

Regression test issue: https://github.com/Expensify/Expensify/issues/409354

All paid. Thanks everyone!

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Archived in project
Development

No branches or pull requests

7 participants