Skip to content

[C+ Checklist Needs Completion] [$500] Web - App does not close Hmm its not here page on selecting current report from search #27580

Closed

Description

@kbecciv

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


Action Performed:

  1. Open the app
  2. Open any report
  3. Trigger full page Hmm its not here page by visiting settings->workspace->any workspace->settings, copy the URL, remove 's' from the end and visit it.
  4. Open search page by CTRL+K
  5. Click on same report as opened in step 2
  6. Observe that app still displays Full page 'Hmm its not here' page instead of report

Expected Result:

App should close Full page 'Hmm its not here' page on selecting any report from search

Actual Result:

App does not close Full page 'Hmm its not here' page on selecting same report as opened in background from search

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.70.5
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Hmm.its.not.here.full.page.not.closed.mp4
Recording.4524.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694765722471659

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ba78cc3a004601db
  • Upwork Job ID: 1703071612120547328
  • Last Price Increase: 2023-10-07
  • Automatic offers:
    • fedirjh | Reviewer | 27150714
    • s-alves10 | Contributor | 27150719
    • dhanashree-sawant | Reporter | 27150722

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 16, 2023
  2. changed the title [-]Web - App does not close Hmm its not here page on selecting current report from search[/-] [+][$500] Web - App does not close Hmm its not here page on selecting current report from search[/+] on Sep 16, 2023
  3. melvin-bot commented on Sep 16, 2023

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  4. melvin-bot commented on Sep 16, 2023

    @melvin-bot
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 16, 2023
  6. melvin-bot commented on Sep 16, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  7. melvin-bot commented on Sep 16, 2023

    @melvin-bot

    Triggered auto assignment to @lschurr (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

  8. melvin-bot commented on Sep 16, 2023

    @melvin-bot

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

  9. abdel-h66 commented on Sep 16, 2023

    @abdel-h66
    Contributor

    Proposal

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

    Web - App does not close Hmm its not here page on selecting current report from search

    What is the root cause of that problem?

    When the serach is opened on the current report. and the current report is clicked We are just dissmissing the Search modal which makes sense because the report is already open.

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

    When the not found page appears, we have the last route name equal to NAVIGATORS.RIGHT_MODAL_NAVIGATOR

    function dismissModal(targetReportID) {

    We can then add a check when the getTopmostReportId is the current report and also when the last route is NAVIGATORS.RIGHT_MODAL_NAVIGATOR this will handle this specific case only and will keep the rest of the behavior intact.

    case SCREENS.REPORT_ATTACHMENTS:
                // if the
                if(targetReportID === getTopmostReportId(rootState) && lastRoute === NAVIGATORS.RIGHT_MODAL_NAVIGATOR) {
                    navigationRef.current.dispatch({...StackActions.pop(2), target: rootState.key});
                    return
                }
                // if we are not in the target report, we need to navigate to it after dismissing the modal
                if (targetReportID && targetReportID !== getTopmostReportId(rootState)) {
                    const state = getStateFromPath(ROUTES.getReportRoute(targetReportID));
                    const action = getActionFromState(state, linkingConfig.config);
                    action.type = 'REPLACE';
                    navigationRef.current.dispatch(action);
                }  else {
                        navigationRef.current.dispatch({...StackActions.pop(), target: rootState.key});
                }
                break;
    

    Notice the use of StackActions.pop(2) instead of StackActions.pop() to make sure we go back twice to reach the previously opened report route.

    The dismissModal function code can be improved but i'm new to the codebase and can't make such big changes and double check all the others cases 😄

    issue-27580-proposal.mp4

    What alternative solutions did you explore? (Optional)

    N/A

  10. dummy-1111 commented on Sep 16, 2023

    @dummy-1111
    Contributor

    Proposal

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

    App doesn't close not-found page when navigating to the not-found page and navigating back to the current report from search

    What is the root cause of that problem?

    If user goes to the not-found page, the navigation stack has 3 navigators: Home, CentralPanNavigator(report), not-found.
    If the user opens the search report modal, the navigation stack has 4, RightModalNavigator is added to the end

    if (targetReportID && targetReportID !== getTopmostReportId(rootState)) {
    const state = getStateFromPath(ROUTES.getReportRoute(targetReportID));
    const action = getActionFromState(state, linkingConfig.config);
    action.type = 'REPLACE';
    navigationRef.current.dispatch(action);
    } else {
    navigationRef.current.dispatch({...StackActions.pop(), target: rootState.key});
    }

    In this case, targetReportID is the same as top-most reportID and so we pop the navigation stack once in line 174. That's why not-found page appears(not closed)

    This is the root cause

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

    We're assuming that we can go to the report by popping once from the RightModalNavigator. This is wrong. We need to generalize this

    We can fix this issue by popping to central navigator

                if (targetReportID && targetReportID !== getTopmostReportId(rootState)) {
                    const state = getStateFromPath(ROUTES.getReportRoute(targetReportID));
    
                    const action = getActionFromState(state, linkingConfig.config);
                    action.type = 'REPLACE';
                    navigationRef.current.dispatch(action);
                } else if (targetReportID && _.some(rootState.routes, route => route.name === SCREENS.NOT_FOUND)) {
                    const lastRouteIndex = rootState.routes.length - 1;
                    const centralRouteIndex = _.findLastIndex(rootState.routes, route => route.name === NAVIGATORS.CENTRAL_PANE_NAVIGATOR);
                    navigationRef.current.dispatch({...StackActions.pop(lastRouteIndex - centralRouteIndex), target: rootState.key});
                } else {
                    navigationRef.current.dispatch({...StackActions.pop(), target: rootState.key});
                }
    

    This works fine

    Result
    27580.mp4

    What alternative solutions did you explore? (Optional)

  11. 50 remaining items

  12. melvin-bot commented on Oct 16, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 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 2023-10-23. 🎊

    After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

    • External issue reporter
    • Contributor that fixed the issue
    • Contributor+ that helped on the issue and/or PR

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

    As a reminder, here are the bonuses/penalties that should be applied for any External issue:

    • Merged PR within 3 business days of assignment - 50% bonus
    • Merged PR more than 9 business days after assignment - 50% penalty
  13. melvin-bot commented on Oct 16, 2023

    @melvin-bot

    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:

    • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
    • [@fedirjh] 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:
    • [@fedirjh] 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:
    • [@fedirjh] Determine if we should create a regression test for this bug.
    • [@fedirjh] 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.
    • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  14. changed the title [-][HOLD for payment 2023-10-23] [HOLD for payment 2023-10-23] [$500] Web - App does not close Hmm its not here page on selecting current report from search[/-] [+][HOLD for payment 2023-10-23] [$500] Web - App does not close Hmm its not here page on selecting current report from search[/+] on Oct 19, 2023
  15. greg-schroeder commented on Oct 23, 2023

    @greg-schroeder
    Contributor

    Processing

  16. greg-schroeder commented on Oct 23, 2023

    @greg-schroeder
    Contributor

    Payments complete. @fedirjh just need you to complete the C+ checklist and we can close this out!

  17. changed the title [-][HOLD for payment 2023-10-23] [$500] Web - App does not close Hmm its not here page on selecting current report from search[/-] [+][C+ Checklist Needs Completion] [$500] Web - App does not close Hmm its not here page on selecting current report from search[/+] on Oct 23, 2023
  18. fedirjh commented on Oct 24, 2023

    @fedirjh
    Contributor

    BugZero Checklist:

    • Link to the PR: I couldn’t find the offending PR, however, the code was refactored during the navigation refactor in @swm/navigation refactor #19263.
    • Link to discussion: N/A This is an extremely minor issue that could be easily overlooked during PR review. I don't think anything could have been done to prevent it.
    • Determine if we should create a regression test for this bug: I'm unsure if we need a regression test for this particular edge case. If necessary, I will suggest one.

    Regression Test Proposal

    1. Open ND and login with any account on web/desktop
    2. Open any report
    3. Send an invalid route inside the report, e.g. : https://new.expensify.com/settings/not-found
    4. click the invalid link you just sent, and it will open a not found page.
    5. Open search page by CMD + K
    6. Select the same report as in step 2
    7. Verify that the report is opened
    • Do we agree 👍 or 👎
  19. greg-schroeder commented on Oct 27, 2023

    @greg-schroeder
    Contributor

    filing regression test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions