Skip to content

Expense - Missing Add expense button when report is created offline on instant submission #77145

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.74-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: Exploratory
Email or phone of affected tester (no customers): jnsdonsoijnods@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Critical User Impact
Device used: Mac 26.1 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Submission frequency is Instantly.
  • Disable Add approvals and Make or track payments.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Go offline.
  4. Click + > Create report.

Expected Result:

Add expense button will be shown when report is created offline.

Actual Result:

Add expense button is missing when report is created offline when workspace is on instant submission.

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

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 9, 2025
  2. melvin-bot commented on Dec 9, 2025

    @melvin-bot

    Triggered auto assignment to @muttmuure (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. melvin-bot commented on Dec 9, 2025

    @melvin-bot

    Triggered auto assignment to @rlinoz (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Dec 9, 2025

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Dec 9, 2025

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. rlinoz commented on Dec 9, 2025

    @rlinoz
    Contributor

    I believe it is coming from #76504

  7. DylanDylann commented on Dec 9, 2025

    @DylanDylann
    Contributor

    @rlinoz Let me check it

  8. Nodebrute commented on Dec 9, 2025

    @Nodebrute
    Contributor

    Proposal

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

    Missing Add expense button when report is created offline on instant submission

    What is the root cause of that problem?

    When a report is created offline with instant submission enabled, the report actions are not loaded yet. The isAwaitingFirstLevelApprovalNew then tries to find the action in an empty array, which returns undefined. When is called, it returns null, and the function incorrectly returns false for empty reports, preventing users from adding the first transaction.

    This bug was already there but it affected the UI in PR #76504, which replaced (deprecated) with isAwaitingFirstLevelApprovalNew. The old function used getSubmitToAccountID(policy, report), which only needed policy data and didn't require report actions to be loaded, so it worked correctly offline. The new function requires report actions to be loaded, causing the issue when they're not available yet.

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

    When report actions are not loaded yet (e.g., offline scenario), check if report is empty and if empty, allow adding transactions by returning true We should add this below line of code here
    https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L2004

        if (!reportActions || reportActions.length === 0) {
            const transactions = getReportTransactions(report?.reportID);
            const transactionCount = report?.transactionCount ?? 0;
            if ((!transactions || transactions.length === 0) && transactionCount === 0) {
                return true;
            }
        }
    

    What alternative solutions did you explore? (Optional)

  9. 3 remaining items

  10. DylanDylann commented on Dec 10, 2025

    @DylanDylann
    Contributor

    The offending PR got reverted

  11. IuliiaHerets commented on Dec 10, 2025

    @IuliiaHerets

    Issue is not reproducible by QA team on Windows 10/Chrome v9.2.74-8

    bandicam.2025-12-10.10-55-55-624.mp4
  12. yuwenmemon commented on Dec 10, 2025

    @yuwenmemon
    Contributor

    Thanks!

  13. m-natarajan commented on Dec 14, 2025

    @m-natarajan

    Issue repro in v9.2.78-0 on Web and Android and iOS, Not repro in production. Added the deploy blocker label as well

    Recording.2073.mp4
    ScreenRecording_12-14-2025.18-25-45_1.MP4
  14. melvin-bot commented on Dec 14, 2025

    @melvin-bot

    Triggered auto assignment to @jasperhuangg (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  15. melvin-bot commented on Dec 14, 2025

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  16. github-actions commented on Dec 14, 2025

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  17. rlinoz commented on Dec 15, 2025

    @rlinoz
    Contributor

    This is for a new checklist and I think it is best if it is handled in the new issue I think #77591

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions