Skip to content

[$250] Expense - The carousel arrows disappear after reloading the page #62017

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.1.45-9
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: #61661
Email or phone of affected tester (no customers): applausetester+bm607@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Web, mweb
App Component: Chat Report View

Action Performed:

Precondition -
Use Expensifail account

  1. Go to https://staging.new.expensify.com/
  2. Create a workspace and go to the workspace chat
  3. Create a report with multiple expenses
  4. Go to report and click on one expense
  5. Reload the page

Expected Result:

The carousel arrows should remain visible after reloading the page

Actual Result:

After reloading the page, the carousel arrows disappear

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/~021924724352227051900
  • Upwork Job ID: 1924724352227051900
  • Last Price Increase: 2025-05-20
  • Automatic offers:
    • thelullabyy | Contributor | 107426287
Issue OwnerCurrent Issue Owner: @greg-schroeder

Activity

  1. added
    Daily
    Bug
    on May 14, 2025
  2. melvin-bot commented on May 14, 2025

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (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. nyomanjyotisa commented on May 14, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    The carousel arrows disappear after reloading the page

    What is the root cause of that problem?

    The carousel relies on transactionReportIDs to determine which sibling expenses to navigate between. However, this data is stored in-memory using a singleton and is lost on page reload, causing the carousel to lose context and not render the arrows.

    const transactionReportIDs: string[] = [];
    /**
    * When single transaction report is displayed in RHP it may need extra context when user navigated to it from MoneyRequestReportView
    * This context are the list of "sibling" report ids.
    * These "siblings" are child report IDs of every transaction connected to the same parent Report that the original transaction.
    *
    * This is a super simple storage to keep these ids. It's implemented as a singleton because we can only ever have 1 RHP opened with report screen.
    */

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

    We should refactor src/components/MoneyRequestReportView/TransactionThreadReportIDRepository.ts to store the data on onyx

    This way, the data survives a page reload and the carousel arrows can continue to function as expected.

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

    None

    What alternative solutions did you explore? (Optional)

    None

  4. added
    External
    on May 20, 2025
  5. melvin-bot commented on May 20, 2025

    @melvin-bot
  6. changed the title [-]Expense - The carousel arrows disappear after reloading the page[/-] [+][$250] Expense - The carousel arrows disappear after reloading the page[/+] on May 20, 2025
  7. added
    Help Wanted
    on May 20, 2025
  8. melvin-bot commented on May 20, 2025

    @melvin-bot

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

  9. thelullabyy commented on May 20, 2025

    @thelullabyy
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-05-22 07:02:27 UTC.

    Proposal

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

    After reloading the page, the carousel arrows disappear

    What is the root cause of that problem?

    The carousel arrows appear based on transactionReportIDs in-memory data. After the page is reloaded, it's cleared

    const reportIDsList = getActiveTransactionThreadIDs();

    We only update this if we open a transaction thread report from MoneyRequestReportTransactionList.

    const sortedSiblingTransactionReportIDs = getThreadReportIDsForTransactions(reportActions, sortedTransactions);
    setActiveTransactionThreadIDs(sortedSiblingTransactionReportIDs);
    Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: reportIDToNavigate, backTo}));
    },
    [reportActions, sortedTransactions],
    );

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

    We can also update transactionReportIDs whenever MoneyRequestReportTransactionList is mounted and the current full screen report route is this report

    useEffect(() => {
        const lastFullScreenRoutes = navigationRef.getRootState()?.routes.findLast((route) => isFullScreenName(route.name));
        if (lastFullScreenRoutes?.name !== NAVIGATORS.REPORTS_SPLIT_NAVIGATOR && lastFullScreenRoutes?.name !== NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR) {
            return;
        }
    
        const lastRoute = lastFullScreenRoutes?.state?.routes?.at(-1);
        if (!lastRoute?.params) {
            return;
        }
        if (lastRoute?.name !== SCREENS.SEARCH.MONEY_REQUEST_REPORT && lastRoute?.name !== SCREENS.REPORT) {
            return;
        }
    
        const reportIDParams = 'reportID' in lastRoute.params ? lastRoute.params.reportID : '';
        if (reportIDParams !== report.reportID) {
            return;
        }
    
        const sortedSiblingTransactionReportIDs = getThreadReportIDsForTransactions(reportActions, transactions);
        setActiveTransactionThreadIDs(sortedSiblingTransactionReportIDs);
    }, [report.reportID, reportActions, transactions]);
    

    const sortedSiblingTransactionReportIDs = getThreadReportIDsForTransactions(reportActions, sortedTransactions);
    setActiveTransactionThreadIDs(sortedSiblingTransactionReportIDs);
    Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: reportIDToNavigate, backTo}));
    },
    [reportActions, sortedTransactions],
    );

    We should remove the useMemo here because reportIDsList is getting from in-memory variable then the useMemo isn't triggered again if reportIDsList is changed. In this case, after we reload the page, reportIDsList is changed from empty array to correct value.

    const {prevReportID, nextReportID} = (() => {
        if (!reportIDsList) {
            return {prevReportID: undefined, nextReportID: undefined};
        }
    
        const currentReportIndex = reportIDsList.findIndex((id) => id === currentReportID);
    
        const prevID = currentReportIndex > 0 ? reportIDsList.at(currentReportIndex - 1) : undefined;
        const nextID = currentReportIndex <= reportIDsList.length - 1 ? reportIDsList.at(currentReportIndex + 1) : undefined;
    
        return {prevReportID: prevID, nextReportID: nextID};
    })();
    

    const reportIDsList = getActiveTransactionThreadIDs();
    const {prevReportID, nextReportID} = useMemo(() => {
    if (!reportIDsList) {
    return {prevReportID: undefined, nextReportID: undefined};
    }
    const currentReportIndex = reportIDsList.findIndex((id) => id === currentReportID);

    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)

    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.

  10. ZerozeroAndre commented on May 20, 2025

    @ZerozeroAndre

    🚨 Edited by proposal-police: This proposal was edited at 2025-05-20 09:50:58 UTC.

    Proposal

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

    After reloading the MoneyRequestReport page, the carousel arrows disappear because the active transaction thread report IDs used to control arrow visibility are cleared.

    What is the root cause of that problem?

    The active transaction thread IDs are currently set only when a user navigates into a transaction from the list. On page reload, this data is lost, so the carousel does not know which reports are part of the thread and hides the arrows.

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

    We should repopulate the active transaction thread report IDs whenever the MoneyRequestReport screen is focused, and the current route matches the report ID shown. This can be done using React Navigation’s useFocusEffect hook inside MoneyRequestReportTransactionList to update the global IDs list from current report actions and transactions.

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

    To solve the issue of carousel arrows disappearing after a page reload, we should ensure that the list of active transaction thread report IDs (transactionReportIDs) is repopulated whenever the MoneyRequestReport screen is focused.

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

    • Confirm that on focusing the MoneyRequestReport screen with matching report ID, the active transaction thread IDs are correctly set.
    • Confirm that on navigating away, the active transaction thread IDs are cleared.
    • Verify after a full page reload, the carousel arrows remain visible and navigation works.

    What alternative solutions did you explore? (Optional)
    None

  11. 27 remaining items

  12. changed the title [-][Due for payment 2025-06-13] [$250] Expense - The carousel arrows disappear after reloading the page[/-] [+][Due for payment 2025-06-16] [Due for payment 2025-06-13] [$250] Expense - The carousel arrows disappear after reloading the page[/+] on Jun 9, 2025
  13. melvin-bot commented on Jun 9, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.62-0 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-16. 🎊

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

  14. melvin-bot commented on Jun 9, 2025

    @melvin-bot

    @hungvu193 @greg-schroeder @hungvu193 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]

  15. added
    Reviewing
    Weekly
    Daily
    and removed
    Weekly
    on Jun 11, 2025
  16. hungvu193 commented on Jun 16, 2025

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

    Regression Test Proposal

    Test:

    1. Create a workspace.
    2. Create a report with multiple expenses.
    3. Go to report and click on expense.
    4. Reload the page.
    5. Verify that the carousel arrow doesn't disappear.
    6. Click on right or left arrow.
    7. Verify that you can move between expense without any issue.

    Do we agree 👍 or 👎

  17. melvin-bot commented on Jun 20, 2025

    @melvin-bot

    @greg-schroeder Whoops! This issue is 2 days overdue. Let's get this updated quick!

  18. greg-schroeder commented on Jun 23, 2025

    @greg-schroeder
    Contributor

    Processing today

  19. changed the title [-][Due for payment 2025-06-16] [Due for payment 2025-06-13] [$250] Expense - The carousel arrows disappear after reloading the page[/-] [+][$250] Expense - The carousel arrows disappear after reloading the page[/+] on Jun 23, 2025
  20. greg-schroeder commented on Jun 24, 2025

    @greg-schroeder
    Contributor

    Payment summary:

    Contributor: @thelullabyy - $250 - Upwork
    C+: @hungvu193 - $250 - ND

  21. garrettmknight commented on Jul 3, 2025

    @garrettmknight
    Contributor

    $250 approved for @hungvu193

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternalReviewing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions