Skip to content

[Due for payment 2025-08-29] [$250] Onboarding - "It is not here... " is shown when refreshing on Test Drive Receipt preview #67360

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: v9.1.87-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: exploratory
Email or phone of affected tester (no customers): gibethlehem@gmail.com
Issue reported by: Applause Internal Team
Device used: macOS/chrome
App Component: Other

Action Performed:

  1. Create a new gmail account
  2. Choose any onboarding intent other than “Manage my team's expenses”
  3. Continue the onboarding flow until you reach "Take us for a test drive" modal
  4. Enter any email address not associated with an existing user
  5. Click on "Start test drive"
  6. On the "Confirm details" screen click on the receipt
  7. Refresh page

Expected Result:

Page stays on the "Confirm details" screen or the Test Drive Receipt preview

Actual Result:

"Create expense" page is shown and "Hmm... it not here" is shown on the background

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/~021952717258906572021
  • Upwork Job ID: 1952717258906572021
  • Last Price Increase: 2025-08-05
Issue OwnerCurrent Issue Owner: @zanyrenney

Activity

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

    @melvin-bot

    Triggered auto assignment to @zanyrenney (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. lorretheboy commented on Jul 30, 2025

    @lorretheboy
    Contributor

    Proposal

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

    Onboarding - "It is not here... " is shown when refreshing on Test Drive Receipt preview

    What is the root cause of that problem?

    Used invalid reportID from test drive blindly (the report ID is 1 by default in onboarding step which means a creating report - so that the data is not existed --> Then causing the "Not here..." issue)

    The ID is getting from here

    const currentURL = getCurrentUrl();
    const reportIdFromPath = currentURL && new URL(currentURL).pathname.match(CONST.REGEX.REPORT_ID_FROM_PATH)?.at(1);

    Then it matches the regex check (a weak check), and go to this follow

    Since it is an invalid report --> Showing "Not here...." issue

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

    The easiest way to check if it is a valid reportID is:

    First, we can get all reports that available

        const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: true});

    Then we need to check if it is really a valid report or not, if not we need to skip it to avoid "Not here" issue
    It is guarantee the correctness and prevent unexpected issues even if we update the default values for creating report later on.

     
            if (reportIdFromPath && allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportIdFromPath}`]?.reportID) {
                return reportIdFromPath;
            }

    if (reportIdFromPath) {
    return reportIdFromPath;
    }

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA

    What alternative solutions did you explore? (Optional)

    To make sure that the check valid report ID are always up to date, we can wrap to useEffect

        const [initialReportID, setInitialReportID] = useState(() => {        
            const initialReport = ReportUtils.findLastAccessedReport(!isBetaEnabled(CONST.BETAS.DEFAULT_ROOMS), shouldOpenOnAdminRoom());
            return initialReport?.reportID ?? '';
        });
    
        useEffect(() => {
            const currentURL = getCurrentUrl();
            const reportIdFromPath = currentURL && new URL(currentURL).pathname.match(CONST.REGEX.REPORT_ID_FROM_PATH)?.at(1);
            
            if (reportIdFromPath && allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportIdFromPath}`]?.reportID) {
                setInitialReportID(reportIdFromPath);
            }
        }, [allReports]);

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. bernhardoj commented on Jul 30, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Not found report screen is shown after refreshing while receipt modal is shown.

    What is the root cause of that problem?

    This can be reproduced with another steps:

    1. Open FAB > Create Expense
    2. Enter any amount
    3. Change the participant to a new user you never chatted before
    4. Add a receipt
    5. Open the receipt
    6. Refresh

    This happens because when we refresh while the receipt modal is open, the receipt modal page route matches the REPORT_ID_FROM_PATH regex, and the report ID from the route will be used as the report ID of the report screen.

    const [initialReportID] = useState(() => {
    const currentURL = getCurrentUrl();
    const reportIdFromPath = currentURL && new URL(currentURL).pathname.match(CONST.REGEX.REPORT_ID_FROM_PATH)?.at(1);
    if (reportIdFromPath) {
    return reportIdFromPath;
    }

    If we choose a participant whom we have never chatted with before, then the report screen will be rendered with the non-existent reportID, and OpenReport will give no report found.

    Image

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

    We have a few options.

    First, we can ignore the reportID if the route contains a transaction with a transaction ID of 1.

    const reportIdFromPath = currentURL && !currentURL.includes('transaction\/1\/') && new URL(currentURL).pathname.match(CONST.REGEX.REPORT_ID_FROM_PATH)?.at(1);
    

    If the transactionID is 1, then it means we are creating a new expense. This is the simplest one to check if we are creating a new expense or not.

    Second, we can ignore the reportID completely for the transaction receipt page route by comparing the pathname with the transaction receipt page regex (new regex).

    Third, we can create a separate route for the transaction receipt page for the new expense flow that doesn't use /r/[reportID] pattern. So, instead of

    r/:reportID/transaction/:transactionID/receipt/:action?/:iouType?

    we can do

    :action/:iouType/receipt/:transactionID/:reportID

    This will be more inline with the other IOU flow route. For example,

    App/src/ROUTES.ts

    Lines 629 to 630 in b73ebe2

    MONEY_REQUEST_STEP_TAX_AMOUNT: {
    route: ':action/:iouType/taxAmount/:transactionID/:reportID?',

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    If we choose first or second, then we can render ReportsSplitNavigator and mock getCurrentUrl to return transaction receipt page and verify the ReportScreen is rendered with reportID not from the receipt page route.

  5. melvin-bot commented on Aug 1, 2025

    @melvin-bot

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

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 5, 2025
  7. melvin-bot commented on Aug 5, 2025

    @melvin-bot
  8. changed the title [-]Onboarding - "It is not here... " is shown when refreshing on Test Drive Receipt preview[/-] [+][$250] Onboarding - "It is not here... " is shown when refreshing on Test Drive Receipt preview[/+] on Aug 5, 2025
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 5, 2025
  10. melvin-bot commented on Aug 5, 2025

    @melvin-bot

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

  11. 26 remaining items

  12. changed the title [-][$250] Onboarding - "It is not here... " is shown when refreshing on Test Drive Receipt preview[/-] [+][Due for payment 2025-08-29] [$250] Onboarding - "It is not here... " is shown when refreshing on Test Drive Receipt preview[/+] on Aug 22, 2025
  13. melvin-bot commented on Aug 22, 2025

    @melvin-bot

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

  14. melvin-bot commented on Aug 22, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.97-5 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 2025-08-29. 🎊

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

    • @jjcoffee requires payment through NewDot Manual Requests
    • @bernhardoj requires payment through NewDot Manual Requests
  15. melvin-bot commented on Aug 22, 2025

    @melvin-bot

    @jjcoffee @zanyrenney The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  16. zanyrenney commented on Aug 29, 2025

    @zanyrenney
    Contributor

    @jjcoffee please can you complete the checklist so we can pay this out?

  17. jjcoffee commented on Aug 29, 2025

    @jjcoffee
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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 - no obvious source for this, it's probably been around for a while

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    Web/Desktop/mWeb

    1. Open FAB > Create Expense
    2. Enter any amount
    3. Change the participant to a new user you never chatted before
    4. Add a receipt
    5. Open the receipt
    6. Refresh
    7. Verify not found report screen is not shown

    For Android & iOS, just make sure the receipt can be opened and closed.

    Do we agree 👍 or 👎

  18. zanyrenney commented on Aug 29, 2025

    @zanyrenney
    Contributor

    Payment summary

    @jjcoffee requires payment through NewDot Manual Requests - $250 to be paid on ND. Please request!
    @bernhardoj requires payment through NewDot Manual Requests - $250 to be paid on ND. Please request!

  19. bernhardoj commented on Aug 29, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  20. JmillsExpensify commented on Aug 31, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  21. quinthar commented on Sep 1, 2025

    @quinthar
    Contributor

    $250 approved for @jjcoffee

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