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-07-17] [$250] Inbox - The entire page blinks when clicking Inbox on Inbox page #43585

Closed
6 tasks done
lanitochka17 opened this issue Jun 12, 2024 · 37 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

@lanitochka17
Copy link

lanitochka17 commented Jun 12, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.82-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. On Inbox page, click Inbox icon
  3. Refresh the page
  4. Click Inbox

Expected Result:

The entire page will not blink

Actual Result:

The entire page blinks
This issue is not reproduced on Search and Account settings page

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

Add any screenshot/video evidence

Bug6510872_1718200620155.20240612_215345.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f33295394aa2f176
  • Upwork Job ID: 1801707280294774711
  • Last Price Increase: 2024-06-21
  • Automatic offers:
    • alitoshmatov | Reviewer | 102890680
    • truph01 | Contributor | 102890682
Issue OwnerCurrent Issue Owner: @puneetlath
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 12, 2024
Copy link

melvin-bot bot commented Jun 12, 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.

@melvin-bot melvin-bot bot added the Overdue label Jun 14, 2024
@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Jun 14, 2024
@melvin-bot melvin-bot bot changed the title Inbox - The entire page blinks when clicking Inbox on Inbox page [$250] Inbox - The entire page blinks when clicking Inbox on Inbox page Jun 14, 2024
Copy link

melvin-bot bot commented Jun 14, 2024

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

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

melvin-bot bot commented Jun 14, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jun 14, 2024
@truph01
Copy link
Contributor

truph01 commented Jun 15, 2024

Proposal

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

The entire page blinks
This issue is not reproduced on Search and Account settings page

What is the root cause of that problem?

  • When click on "Inbox" button, we call:

    const navigateToChats = useCallback(() => {
    const route = activeWorkspaceID ? (`/w/${activeWorkspaceID}/home` as Route) : ROUTES.HOME;
    Navigation.navigate(route);
    }, [activeWorkspaceID]);

  • In navigate function, this logic is called:

    const actionForBottomTabNavigator = getActionForBottomTabNavigator(action, rootState, policyID, shouldNavigate);
    if (!actionForBottomTabNavigator) {
    return;
    }

  • In expected, actionForBottomTabNavigator in above should be undefined, so the function will do nothing if user has already been in the /home page, but in this case, actionForBottomTabNavigator in not undefined.

  • So let's take a look at the getActionForBottomTabNavigator to find the RCA.

  • In getActionForBottomTabNavigator, we already have logic to do nothing if the current bottom tab is the same as the one we want to navigate to:

    // Check if the current bottom tab is the same as the one we want to navigate to. If it is, we don't need to do anything.
    const bottomTabCurrentTab = getTopmostBottomTabRoute(state);
    const bottomTabParams = bottomTabCurrentTab?.params as Record<string, string | undefined>;
    // Verify if the policyID is different than the one we are currently on. If it is, we need to navigate to the new policyID.
    const isNewPolicy = bottomTabParams?.policyID !== payloadParams?.policyID;
    if (bottomTabCurrentTab?.name === screen && !shouldNavigate && !isNewPolicy) {
    return;
    }

  • In this case, the expected is that isNewPolicy: false but actually, it is true because isNewPolicy = bottomTabParams?.policyID !== payloadParams?.policyID with bottomTabParams?.policyID: undefined and payloadParams?.policyID: '' (we can console.log in this line to see these values).

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

    const isNewPolicy = (!!bottomTabParams?.policyID || !!payloadParams?.policyID) &&  bottomTabParams?.policyID !== payloadParams?.policyID;

What alternative solutions did you explore? (Optional)

@alitoshmatov
Copy link
Contributor

@truph01 Thank you for your proposal, your RCA is correct and your solution does solve the problem. But this issue is also happening for search page, when you go to search page, refresh and then click on search page expenses list is refreshing and blinking. Ideally we should solve that too

@truph01
Copy link
Contributor

truph01 commented Jun 18, 2024

@alitoshmatov

this issue is also happening for search page

  • It can be fixed with my alternative solution.

@alitoshmatov
Copy link
Contributor

@truph01 I didn't understand what you mean by that, I mean it is not search page has separate navigate function which is not related to home pages navigation function

@truph01
Copy link
Contributor

truph01 commented Jun 18, 2024

@alitoshmatov

@alitoshmatov
Copy link
Contributor

@truph01 This solution does not work, navigation to home tab is completely not working, clicking on search tab is not going to the first menu item. This looks like a workaround for me

Screen.Recording.2024-06-19.at.3.08.07.PM.mov

@truph01
Copy link
Contributor

truph01 commented Jun 19, 2024

@alitoshmatov You mean my main solution or alternative solution?

@alitoshmatov
Copy link
Contributor

Your main solution solves the issue only for home tab

My latest response was for solution you provided here

@truph01
Copy link
Contributor

truph01 commented Jun 19, 2024

I implement this solution and it still works on my side:

Screen.Recording.2024-06-19.at.17.25.36.mov

@truph01
Copy link
Contributor

truph01 commented Jun 19, 2024

@alitoshmatov Here is the detail code changes:

  1. const navigateToChats = useCallback(() => {
    const route = activeWorkspaceID ? (`/w/${activeWorkspaceID}/home` as Route) : ROUTES.HOME;
    Navigation.navigate(route);
    }, [activeWorkspaceID]);
    const navigateToChats = useCallback(() => {
        if (currentTabName === SCREENS.HOME) {
            return;
        }
        const route = activeWorkspaceID ? (`/w/${activeWorkspaceID}/home` as Route) : ROUTES.HOME;
        Navigation.navigate(route);
    }, [activeWorkspaceID, currentTabName]);
  1. onPress={() => {
    interceptAnonymousUser(() => Navigation.navigate(ROUTES.SEARCH.getRoute(CONST.TAB_SEARCH.ALL)));
    }}
                    onPress={() => {
                        if (currentTabName === SCREENS.SEARCH.BOTTOM_TAB) {
                            return;
                        }
                        interceptAnonymousUser(() => Navigation.navigate(ROUTES.SEARCH.getRoute(CONST.TAB_SEARCH.ALL)));
                    }}

in the above if (currentTabName === SCREENS.SEARCH.BOTTOM_TAB) { condition, we can consider adding || currentTabName === SCREENS.SEARCH.CENTRAL_PANE as well

@alitoshmatov
Copy link
Contributor

@truph01 search page is still blinking when pressed right after refreshing it. Adding currentTabName === SCREENS.SEARCH.CENTRAL_PANE additionally does prevent blinking but it also causes menu item not going back to the first one when search tab is pressed.

@truph01
Copy link
Contributor

truph01 commented Jun 19, 2024

Adding currentTabName === SCREENS.SEARCH.CENTRAL_PANE additionally does prevent blinking

  • I mean we use if (currentTabName === SCREENS.SEARCH.BOTTOM_TAB || currentTabName === SCREENS.SEARCH.CENTRAL_PANE) {. With this, the blink issue does not appear. Here is the result:
Screen.Recording.2024-06-19.at.18.12.01.mov

menu item not going back to the first one when search tab is pressed.

  • I think it is based on our expected. If we do not want to go back to the first one, we use if (currentTabName === SCREENS.SEARCH.BOTTOM_TAB || currentTabName === SCREENS.SEARCH.CENTRAL_PANE) {. If want, we use if (currentTabName === SCREENS.SEARCH.BOTTOM_TAB) {

@truph01
Copy link
Contributor

truph01 commented Jun 19, 2024

@puneetlath When users are already on search page, the "Search" icon in bottom tab is highlighted and the focused option in the left-hand screen is something like "Shared" "Draft", or "Finished". Then user clicks on the "Search" icon in the bottom tab. Should the focused option in left-hand screen reset to the first option, "Expenses"?

@puneetlath
Copy link
Contributor

Hmm, good question. @luacmartins what do you think?

@luacmartins
Copy link
Contributor

I don't think we should reset the view in that case, they are already in the Search page so we should just return early instead of navigating again.

Copy link

melvin-bot bot commented Jun 21, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Jun 21, 2024
Copy link

melvin-bot bot commented Jun 24, 2024

@puneetlath, @alitoshmatov Huh... This is 4 days overdue. Who can take care of this?

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

melvin-bot bot commented Jun 26, 2024

📣 @alitoshmatov 🎉 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 26, 2024

📣 @truph01 🎉 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 27, 2024
@truph01
Copy link
Contributor

truph01 commented Jun 27, 2024

@alitoshmatov PR is ready

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 10, 2024
@melvin-bot melvin-bot bot changed the title [$250] Inbox - The entire page blinks when clicking Inbox on Inbox page [HOLD for payment 2024-07-17] [$250] Inbox - The entire page blinks when clicking Inbox on Inbox page Jul 10, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

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

Copy link

melvin-bot bot commented Jul 10, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.5-13 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-07-17. 🎊

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

Copy link

melvin-bot bot commented Jul 10, 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:

  • [@alitoshmatov] The PR that introduced the bug has been identified. Link to the PR:
  • [@alitoshmatov] 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:
  • [@alitoshmatov] 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:
  • [@alitoshmatov] Determine if we should create a regression test for this bug.
  • [@alitoshmatov] 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 Weekly KSv2 and removed Weekly KSv2 labels Jul 15, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-17] [$250] Inbox - The entire page blinks when clicking Inbox on Inbox page [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Inbox - The entire page blinks when clicking Inbox on Inbox page Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

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

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

Copy link

melvin-bot bot commented Jul 15, 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:

  • [@alitoshmatov] The PR that introduced the bug has been identified. Link to the PR:
  • [@alitoshmatov] 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:
  • [@alitoshmatov] 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:
  • [@alitoshmatov] Determine if we should create a regression test for this bug.
  • [@alitoshmatov] 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 Jul 16, 2024
@puneetlath puneetlath changed the title [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Inbox - The entire page blinks when clicking Inbox on Inbox page [HOLD for payment 2024-07-17] [$250] Inbox - The entire page blinks when clicking Inbox on Inbox page Jul 16, 2024
@puneetlath
Copy link
Contributor

@alitoshmatov friendly reminder about the checklist so we can pay tomorrow.

@puneetlath
Copy link
Contributor

@truph01 has been paid. Still waiting on the checklist for @alitoshmatov.

@alitoshmatov alitoshmatov mentioned this issue Jul 17, 2024
49 tasks
@alitoshmatov
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Fix chat navigation #42684
  • 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: https://github.com/Expensify/App/pull/42684/files#r1681312172
  • 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: No need
  • Determine if we should create a regression test for this bug. I don't think regression test is needed since it is pretty noticeable bug

@puneetlath
Copy link
Contributor

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

5 participants