Skip to content

[$250] Expense - Second track expense submitted to ws while offline, is displayed duplicated #58321

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.12-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the staging.new.expensify.com website
  2. Sign up with a new account
  3. Turn off internet connection
  4. Tap on FAB and select "Create Expense"
  5. Complete the creation flow and submit the expense to Self Dm
  6. Tap on "Share with my accountant" on the system message below the expense
  7. Send the expense to the new created workspace
  8. Once redirected to chat, dismiss the RHP and return to Self DM
  9. Tap on the "+" button and create a second track expense
  10. Tap on "Share with my accountant" and send this second expense to the same workspace as the first one
  11. Dismiss the RHP and turn on internet connection
  12. Note that now, the second expense is displayed in small size in chat, and is also displayed inside expense report with the first one created

Expected Result:

Track expenses moved to a workspace while offline, should be displayed only once when recoveing internet connection

Actual Result:

Second track expense submitted to new workspace while offline, is displayed duplicated when turning internet connection on. The expense preview is displayed in a smaller size in chat, and is also displayed inside expense report with the first submitted expense

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6768909_1741802912661.Duplicated.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021902287746223369014
  • Upwork Job ID: 1902287746223369014
  • Last Price Increase: 2025-06-11
Issue OwnerCurrent Issue Owner: @dominictb

Activity

  1. added
    Bug
    Daily
    on Mar 12, 2025
  2. melvin-bot commented on Mar 12, 2025

    @melvin-bot

    Triggered auto assignment to @JmillsExpensify (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 Mar 13, 2025

    @bernhardoj
    Contributor

    Proposal

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

    When sharing track expense while offline, 2 expense report is created, but after going online, the report is merged.

    What is the root cause of that problem?

    When we share the track expense, it will create a new expense report if the expense only contains non-reimbursable transaction as defined below.

    App/src/libs/ReportUtils.ts

    Lines 2158 to 2160 in c3aa5d6

    if (isInstantSubmitEnabled(policy) && isSubmitAndClose(policy) && hasOnlyNonReimbursableTransactions(moneyRequestReport?.reportID)) {
    return false;
    }

    It was added in #44612. But looks like the BE now keep the expenses in one expense report.

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

    It could be a BE problem and if it's, then we need to fix it on the BE. If the BE is intentional, then we need to remove this condition.

    App/src/libs/ReportUtils.ts

    Lines 2158 to 2160 in c3aa5d6

    if (isInstantSubmitEnabled(policy) && isSubmitAndClose(policy) && hasOnlyNonReimbursableTransactions(moneyRequestReport?.reportID)) {
    return false;
    }

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

    We can create a unit test for canAddTransaction and assert that it returns true for expense report with only non-reimbursable transaciton.

  4. melvin-bot commented on Mar 18, 2025

    @melvin-bot

    @JmillsExpensify Eep! 4 days overdue now. Issues have feelings too...

  5. added
    External
    on Mar 19, 2025
  6. changed the title [-]Expense - Second track expense submitted to ws while offline, is displayed duplicated[/-] [+][$250] Expense - Second track expense submitted to ws while offline, is displayed duplicated[/+] on Mar 19, 2025
  7. melvin-bot commented on Mar 19, 2025

    @melvin-bot
  8. added
    Help Wanted
    on Mar 19, 2025
  9. melvin-bot commented on Mar 19, 2025

    @melvin-bot

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

  10. JmillsExpensify commented on Mar 19, 2025

    @JmillsExpensify
    Contributor

    Opened up to the community.

  11. 37 remaining items

  12. melvin-bot commented on Apr 30, 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? 💸

  13. melvin-bot commented on May 7, 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? 💸

  14. dominictb commented on May 9, 2025

    @dominictb
    Contributor

    @youssef-lr is handling this.

  15. JmillsExpensify commented on May 12, 2025

    @JmillsExpensify
    Contributor

    Still a monthly

  16. melvin-bot commented on May 14, 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? 💸

  17. melvin-bot commented on May 21, 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? 💸

  18. melvin-bot commented on May 28, 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? 💸

  19. melvin-bot commented on Jun 4, 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? 💸

  20. melvin-bot commented on Jun 11, 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? 💸

  21. mvtglobally commented on Jun 16, 2025

    @mvtglobally

    Issue not reproducible during KI retests. (First week)

  22. JmillsExpensify commented on Jun 18, 2025

    @JmillsExpensify
    Contributor

    @youssef-lr going to close though please reopen if you or anyone else can reproduce.

  23. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugExternalHelp WantedMonthly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions