Skip to content

[$250] Hybrid app - Not back to the report screen after closing and reopening the app #72656

Closed

Description

@jponikarchuk

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: 9.2.31-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #72089
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Android 13 / Xiaomi Poco F5, iOS 15.8.3 / iPhone 7 Plus
App Component: Other

Action Performed:

Precondition:

  • User B send IOU to User A
  1. Login to the Hybrid app using User A's account
  2. Open IOU report from User B
  3. Close the app and reopen it

Expected Result:

Reopen the app - it should initialize directly on the report screen.

Actual Result:

User does not navigate back to the report screen after closing and reopening the app

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021978554120600277830
  • Upwork Job ID: 1978554120600277830
  • Last Price Increase: 2025-10-22
Issue OwnerCurrent Issue Owner: @

Activity

  1. added
    Daily
    Bug
    on Oct 15, 2025
  2. melvin-bot commented on Oct 15, 2025

    @melvin-bot

    Triggered auto assignment to @isabelastisser (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. bernhardoj commented on Oct 15, 2025

    @bernhardoj
    Contributor

    Proposal

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

    App doesn't reopen report after reopen the app.

    What is the root cause of that problem?

    We only reopen the report if the reportID is found in the last visited path.

    export default function shouldOpenLastVisitedPath(lastVisitedPath: Route) {
    return !!lastVisitedPath && !!getReportIDFromLink(lastVisitedPath);
    }

    App/src/libs/ReportUtils.ts

    Lines 9008 to 9016 in 0ce96e0

    function getReportIDFromLink(url: string | null): string {
    const route = getRouteFromLink(url);
    const {reportID, isSubReportPageRoute} = parseReportRouteParams(route);
    if (isSubReportPageRoute) {
    // We allow the Sub-Report deep link routes (settings, details, etc.) to be handled by their respective component pages
    return '';
    }
    return reportID;
    }

    In OP, we open the report from the Reports tab, but the current logic only checks for the Report screen opened from Home.

    App/src/libs/ReportUtils.ts

    Lines 8981 to 8990 in 0ce96e0

    function parseReportRouteParams(route: string): ReportRouteParams {
    let parsingRoute = route;
    if (parsingRoute.at(0) === '/') {
    // remove the first slash
    parsingRoute = parsingRoute.slice(1);
    }
    if (!parsingRoute.startsWith(addTrailingForwardSlash(ROUTES.REPORT))) {
    return {reportID: '', isSubReportPageRoute: false};
    }

    App/src/libs/ReportUtils.ts

    Lines 9001 to 9005 in 0ce96e0

    return {
    reportID,
    // We're checking the route start with `r/`, the sub report route is the route that we can open from report screen like `r/:reportID/details`
    isSubReportPageRoute: focusedRoute?.name !== SCREENS.REPORT,
    };

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

    We need to update parseReportRouteParams logic so it checks for search money request report page.

    if (!parsingRoute.startsWith(addTrailingForwardSlash(ROUTES.REPORT)) && !parsingRoute.startsWith(addTrailingForwardSlash(ROUTES.SEARCH_MONEY_REQUEST_REPORT.route.replace(":reportID", "")))) {
        return {reportID: '', isSubReportPageRoute: false};
    }
    
    ...
    
    return {
        ...,
        isSubReportPageRoute: focusedRoute?.name !== SCREENS.REPORT && focusedRoute?.name !== SCREENS.SEARCH.MONEY_REQUEST_REPORT,
    }
    
  4. mountiny commented on Oct 15, 2025

    @mountiny
    Contributor

    @collectioneur @WojtekBoman might be related to your PR here #72089 can you take a look?

  5. added
    External
    Help Wanted
    on Oct 15, 2025
  6. melvin-bot commented on Oct 15, 2025

    @melvin-bot
  7. changed the title [-]Hybrid app - Not back to the report screen after closing and reopening the app[/-] [+][$250] Hybrid app - Not back to the report screen after closing and reopening the app[/+] on Oct 15, 2025
  8. melvin-bot commented on Oct 15, 2025

    @melvin-bot

    Current assignee @abdulrahuman5196 is eligible for the External assigner, not assigning anyone new.

  9. collectioneur commented on Oct 16, 2025

    @collectioneur
    Contributor

    @mountiny I believe this bug isn't related to my PR, because the tester opens the report from the reports page, not from the chats. The issue is that when you open a report through the chats, you get redirected to /r/:reportID, but when you open it from the reports page, you get redirected to /search/r/:reportID, where the check isn’t applied. I verified that this bug existed even before my PR - here’s the video with my discarded change:

    Screen.Recording.2025-10-16.at.14.25.37.mov

    If you want, I can fix it (it would be enough to add the same check for /search/r/:reportID).

  10. abdulrahuman5196 commented on Oct 20, 2025

    @abdulrahuman5196
    Contributor

    I am not sure if this is a regression. But I am not able to repro the required close and reopen even in the normal chats report view.

    Do i need to do anything else to use this feature?
    I am observing the same in app store app as well

    Screen.Recording.2025-10-20.at.1.52.34.PM.mov
  11. melvin-bot commented on Oct 22, 2025

    @melvin-bot

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

  12. isabelastisser commented on Oct 22, 2025

    @isabelastisser
    Contributor

    Not reproducible; closing.

  13. mountiny commented on Oct 22, 2025

    @mountiny
    Contributor

    @bernhardoj are you able to reproduce this one?

  14. bernhardoj commented on Oct 23, 2025

    @bernhardoj
    Contributor

    But I am not able to repro the required close and reopen even in the normal chats report view.

    You need to use a private domain account.

    In my case, I just removed the public domain check here to test it easier.

    if (!account || account.isFromPublicDomain) {
    return;
    }

    But I can't reproduce this anymore because shouldOpenLastVisitedPath/index.native.ts file does not exist anymore.

    export default function shouldOpenLastVisitedPath(lastVisitedPath: Route) {
    return !!lastVisitedPath;
    }

    This is what shouldOpenLastVisitedPath/index.native.ts looks like previously.

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

Metadata

Metadata

Labels

BugDailyExternalHelp Wanted

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions