Skip to content

[Due for payment 2025-06-17] [$250] Android - search-Search results are opened with delay #62026

Closed

Description

@lanitochka17

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.1.45-7
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. Launch app
  2. Login with account with more chats
  3. Tab Search icon and then click any chat

Expected Result:

Tapping on a chat, it must be opened immediately without showing previously visited page is seen briefly

Actual Result:

Tapping on a chat, it is opened little bit delayed and previously visited page is seen briefly

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6830896_1747226601972.Screenrecorder-2025-05-14-18-03-50-558.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021924952971705229540
  • Upwork Job ID: 1924952971705229540
  • Last Price Increase: 2025-05-20
Issue OwnerCurrent Issue Owner: @johncschuster

Activity

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

    @melvin-bot

    Triggered auto assignment to @johncschuster (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 May 15, 2025

    @bernhardoj
    Contributor

    Proposal

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

    The report is opened with delay when opening it from the search modal.

    What is the root cause of that problem?

    When we select an item, we delay the action with a promise.

    backHistory().then(() => {
    if (item?.reportID) {
    Navigation.navigateToReportWithPolicyCheck({reportID: item?.reportID});
    } else if ('login' in item) {
    navigateToAndOpenReport(item.login ? [item.login] : [], false);
    }
    });

    As written, it's for mobile chrome only. Even though it's immediately resolved, it looks like it still delays on Android.

    /**
    * This function is used to trigger a browser back navigation and resolves a promise once the navigation is complete (only on mobile Chrome).
    * More details - https://github.com/Expensify/App/issues/58946.
    */
    export default function backHistory() {
    return new Promise<void>((resolve) => {
    if (!isMobileChrome()) {
    resolve();
    return;
    }
    const onPopState = () => {
    window.removeEventListener('popstate', onPopState);
    resolve();
    };
    window.addEventListener('popstate', onPopState);
    window.history.back();
    });

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

    For non mWeb Android, we should immediately calls the action. We can follow the Modal.close pattern.

    function close(onModalCloseCallback: () => void, isNavigating = true, shouldCloseAllModals = false) {
    if (closeModals.length === 0) {
    onModalCloseCallback();
    return;
    }
    onModalClose = onModalCloseCallback;
    shouldCloseAll = shouldCloseAllModals;
    isNavigate = isNavigating;
    closeTop();
    }

    So, instead of returning a promise, it accepts a callback to be calls later.

    export default function backHistory(callback: () => void) {
        if (!isMobileChrome()) {
            callback();
            return;
        }
    
        const onPopState = () => {
            window.removeEventListener('popstate', onPopState);
            callback();
        };
    
        window.addEventListener('popstate', onPopState);
        window.history.back();
    }
    

    We can also create a separate file for web and native.

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

    N/A

  4. melvin-bot commented on May 20, 2025

    @melvin-bot

    @johncschuster Huh... This is 4 days overdue. Who can take care of this?

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 20, 2025
  6. changed the title [-]Android - search-Search results are opened with delay[/-] [+][$250] Android - search-Search results are opened with delay[/+] on May 20, 2025
  7. melvin-bot commented on May 20, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 20, 2025
  9. melvin-bot commented on May 20, 2025

    @melvin-bot

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

  10. jayeshmangwani commented on May 22, 2025

    @jayeshmangwani
    Contributor

    @bernhardoj 's proposal looks promising. If backHistory is causing delays, we can split the logic into separate files for web and native. For the mweb, we can add promise/callback handling, while for native and other platforms (except mweb), we can call the action immediately.

    🎀 👀 🎀 C+ reviewed

  11. 25 remaining items

  12. changed the title [-][$250] Android - search-Search results are opened with delay[/-] [+][Due for payment 2025-06-17] [$250] Android - search-Search results are opened with delay[/+] on Jun 10, 2025
  13. melvin-bot commented on Jun 10, 2025

    @melvin-bot

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

  14. melvin-bot commented on Jun 10, 2025

    @melvin-bot

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

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

  15. melvin-bot commented on Jun 10, 2025

    @melvin-bot

    @jayeshmangwani @johncschuster @jayeshmangwani 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. johncschuster commented on Jun 12, 2025

    @johncschuster
    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:

    • [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:

    • [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.

    Regression Test Proposal Template
    • [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

    Precondition:

    Test:

    Do we agree 👍 or 👎

  17. jayeshmangwani commented on Jun 17, 2025

    @jayeshmangwani
    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: fix: duplicate history in mobile chrome #61297 (comment)

    • [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.

    This is a common navigation flow, so dont think we need the specific Regression test is needed for this search list navigation delay.

  18. melvin-bot commented on Jun 17, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@johncschuster)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1924952971705229540/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  19. johncschuster commented on Jun 17, 2025

    @johncschuster
    Contributor

    Payment Summary

    Contributor: @bernhardoj due $250 via NewDot
    Contributor+: @jayeshmangwani due $250 via NewDot

  20. garrettmknight commented on Jun 19, 2025

    @garrettmknight
    Contributor

    $250 approved for @jayeshmangwani

  21. bernhardoj commented on Jun 20, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  22. JmillsExpensify commented on Jul 2, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions