Skip to content

[Awaiting Payment 30th May] [Search v1] Chat - "From" link in IOU report details page navigates to the main chat twice #41198

Closed

Description

@izarutskaya

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.67-0
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Launch New Expensify app.
  2. Submit an expense to a user.
  3. In 1:1 DM, tap on the IOU preview.
  4. Tap on the chat header.
  5. Tap "From" link.
  6. Tap on the back button.

Expected Result:

App will return to report details page.

Actual Result:

App returns to the same main chat. It only returns to report details page after tapping on the back button again.

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

Bug6464770_1714364034837.RPReplay_Final1714363561.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c414e0c471cc81d1
  • Upwork Job ID: 1786350359808901120
  • Last Price Increase: 2024-05-03
  • Automatic offers:
    • s77rt | Reviewer | 0
    • bernhardoj | Contributor | 0
Issue OwnerCurrent Issue Owner: @s77rt

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 29, 2024
  2. melvin-bot commented on Apr 29, 2024

    @melvin-bot

    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.

  3. izarutskaya commented on Apr 29, 2024

    @izarutskaya
    Author

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

  4. bernhardoj commented on Apr 29, 2024

    @bernhardoj
    Contributor

    Proposal

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

    The navigation to the parent report happens twice.

    What is the root cause of that problem?

    When we press the "From" link, it will call goBack with the report screen as the fallback which will be used twice. One without the report action ID and the other one with the report action ID for comment linking.

    // Pop the thread report screen before navigating to the chat report.
    Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
    if (isVisibleAction && !isOffline) {
    // Pop the chat report screen before navigating to the linked report action.
    Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));
    }

    The issue happens after this PR where we will push the screen if the params is different, in this case, the report action ID param.

    const isTargetScreenDifferentThanCurrent = Boolean(topmostCentralPaneRoute && topmostCentralPaneRoute.name !== action.payload.params?.screen);
    const areParamsDifferent = !shallowCompare(topmostCentralPaneRoute?.params, action.payload.params?.params);
    // In case if type is 'FORCED_UP' we replace current screen with the provided. This means the current screen no longer exists in the stack
    if (type === CONST.NAVIGATION.TYPE.FORCED_UP) {
    action.type = CONST.NAVIGATION.ACTION_TYPE.REPLACE;
    // If this action is navigating to the report screen and the top most navigator is different from the one we want to navigate - PUSH the new screen to the top of the stack
    } else if (action.payload.name === NAVIGATORS.CENTRAL_PANE_NAVIGATOR && (isTargetScreenDifferentThanCurrent || areParamsDifferent)) {
    // We need to push a tab if the tab doesn't match the central pane route that we are going to push.
    const topmostBottomTabRoute = getTopmostBottomTabRoute(rootState);
    const matchingBottomTabRoute = getMatchingBottomTabRouteForState(stateFromPath, policyID);
    const isNewPolicyID =
    (topmostBottomTabRoute?.params as Record<string, string | undefined>)?.policyID !== (matchingBottomTabRoute?.params as Record<string, string | undefined>)?.policyID;
    if (topmostBottomTabRoute && (topmostBottomTabRoute.name !== matchingBottomTabRoute.name || isNewPolicyID)) {
    root.dispatch({
    type: CONST.NAVIGATION.ACTION_TYPE.PUSH,
    payload: matchingBottomTabRoute,
    });
    }
    action.type = CONST.NAVIGATION.ACTION_TYPE.PUSH;

    Previously, we only compare the report ID to decide whether to push the report screen or not.

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

    I think we want to have the old behavior, that is to push the report screen only if the topmost report ID is different than the destination report ID, if it's other screen, then we will use the current condition.

    const areParamsDifferent = action.payload.params?.screen === SCREENS.REPORT
        ? getTopmostReportId(rootState) !== getTopmostReportId(stateFromPath)
        : !shallowCompare(topmostCentralPaneRoute?.params, action.payload.params?.params);
    
  5. melvin-bot commented on May 2, 2024

    @melvin-bot

    @trjExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  6. trjExpensify commented on May 3, 2024

    @trjExpensify
    Contributor

    @luacmartins @grgia putting this on your radar! I'll file it under Search v1.

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 3, 2024
  8. melvin-bot commented on May 3, 2024

    @melvin-bot
  9. changed the title [-]Chat - "From" link in IOU report details page navigates to the main chat twice[/-] [+][$250] Chat - "From" link in IOU report details page navigates to the main chat twice[/+] on May 3, 2024
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 3, 2024
  11. 21 remaining items

  12. bernhardoj commented on May 10, 2024

    @bernhardoj
    Contributor

    PR is ready

    cc: @s77rt

  13. melvin-bot commented on Jun 3, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. @trjExpensify, @s77rt, @luacmartins, @bernhardoj eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  14. changed the title [-][Search v1] Chat - "From" link in IOU report details page navigates to the main chat twice[/-] [+][Awaiting Payment 30th May] [Search v1] Chat - "From" link in IOU report details page navigates to the main chat twice[/+] on Jun 3, 2024
  15. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Jun 3, 2024
  16. trjExpensify commented on Jun 3, 2024

    @trjExpensify
    Contributor

    Payment summary as follows:

    Paid. Closing!

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions