Skip to content

Error shows up when saving unreported splits after upgrading workspace and changing rate #97395

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.46-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #92055
Email or phone of affected tester (no customers): iosjdnojsdoijdisojiso@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Account has no workspace.
  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Create a distance expense.
  4. Open the expense.
  5. Click More > Split > Save.
  6. Open any split.
  7. Click Amount.
  8. Click on the split.
  9. Click Rate.
  10. Click Upgrade > Confirm > Got it, thanks.
  11. Enter rate and save it.
  12. Select a rate.
  13. Edit the other split and select rate.
  14. Save the splits.

Expected Result:

The splits will be saved without issue.

Actual Result:

Error shows up when saving unreported splits after upgrading workspace and changing rate.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7221270_1785359494910.4.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7221270

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 29, 2026
  2. applause-bot commented on Jul 29, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/e60a81abd81309f744007b48078d368d951146aeb7c3f0f3e700733ac8e89650

  3. melvin-bot commented on Jul 29, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #92055

  4. melvin-bot commented on Jul 29, 2026

    @melvin-bot

    @lakchote @dmkt9 you have been assigned to this deploy blocker because you reviewed the offending PR: #92055

  5. melvin-bot commented on Jul 29, 2026

    @melvin-bot

    @ZhenjaHorbach you have been assigned to this deploy blocker because you authored the offending PR: #92055

  6. melvin-bot commented on Jul 29, 2026

    @melvin-bot

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

  7. github-actions commented on Jul 29, 2026

    @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.
  8. MelvinBot commented on Jul 29, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #92055 - "Fix bugs for selfDM splits feature" by ZhenjaHorbach (High confidence)
    Related Issues: N/A

    Recommendation: ROLL FORWARD

    PR #92055 is confirmed as the cause, but it is itself a bug-fix PR that resolves 8 other selfDM-split issues (#91874, #91876, #91879, #91907, #91913, #91917, #91920, #91918). Reverting it would reintroduce those bugs, so a targeted forward-fix by the PR author is safer than a revert. The feature is not in production (staging-only), so this only blocks the App staging deploy.

    Assigned: ZhenjaHorbach (PR author), lakchote and dmkt9 (approving reviewers) — already assigned to this issue.
    Labels: No changes. DeployBlockerCash is kept (App PR caused the issue → App deploy is blocked). DeployBlocker was not present, so nothing to remove.

    📋 Detailed Analysis

    Evidence

    • The reproduction path — self-DM split → Amount → Rate → Upgrade workspace → enter/select rate → edit other split → Save — is exactly the flow reworked by PR #92055. The PR's title is literally "Fix bugs for selfDM splits feature."
    • The version reported (9.4.46-0) is staging-only and N/A in production because this is a brand-new feature. PR #92055 is listed in the current StagingDeployCash checklist (item 76) and merged 2026-07-29 09:35Z, ~12h before the bug was filed (2026-07-29 21:54Z).
    • The PR touches every file on the affected code path: SplitExpensePage.tsx, SplitExpenseEditPage.tsx, IOURequestStepDistanceRate.tsx, IOURequestStepUpgrade.tsx, SplitTransactionUpdate.ts, Split.ts, SplitExpenseItems.ts, DistanceRequestUtils.ts, and TransactionUtils/index.ts.

    Verification

    Affected area = saving self-DM distance splits after a workspace upgrade + rate change. PR #92055 modifies the exact save/rate-resolution logic for that flow:

    • src/pages/iou/SplitExpensePage.tsx:211-279 — the save handler and the per-split "out of policy" rate validation loop were rewritten, including the new extraIOUActions param passed into updateSplitTransactions.
    • src/libs/DistanceRequestUtils.ts:599-614 — new getEnabledRateByCustomUnitRateIDFromAnyPolicy helper that resolves a rate across all of the user's policies (used specifically because a self-DM split on the personal/P2P rate has no effectivePolicy).
    • src/libs/TransactionUtils/index.ts:742-761 — getUpdatedTransaction now takes a policies collection and falls back to the cross-policy rate lookup, then re-runs the distance-unit/quantity conversion against the fallback rate's unit.
    • src/libs/actions/IOU/SplitTransactionUpdate.ts — the isReverseSplitOperation / isCreationOfSplits detection was changed to count all child transactions (previously it excluded UNREPORTED_REPORT_ID children), and new group-amount rescaling (findSnapshotGroupSourceTransaction / rescaleSnapshotGroupAmount) was added.

    Root Cause

    When the just-upgraded workspace becomes the rate owner, the newly-added cross-policy rate resolution and the reworked reverse/creation split detection govern how the unreported splits are re-priced and written on save. The most likely trigger for the on-save error is a rate/policy mismatch in this new logic: for a self-DM split, effectivePolicy can be undefined and the code relies on getEnabledRateByCustomUnitRateIDFromAnyPolicy plus the isReverseSplitOperation change (now allChildTransactions.length > 0 without the previous UNREPORTED_REPORT_ID filter) to decide which fields are cleared and re-sent. If the selected rate can't be resolved for the freshly-created workspace at save time, the split is flagged out-of-policy / the update params are built inconsistently, surfacing the error. Pinning the exact failing line requires runtime logs / the API error code, hence the recommendation to have the author reproduce and forward-fix (High confidence on the causing PR, medium on the precise line).

  9. 2 remaining items

  10. added
    ReviewingHas a PR in review
    and removed on Jul 30, 2026
  11. melvin-bot commented on Aug 6, 2026

    @melvin-bot

    @lakchote, @ZhenjaHorbach, @dmkt9 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  12. melvin-bot commented on Aug 10, 2026

    @melvin-bot

    @lakchote, @ZhenjaHorbach, @dmkt9 Still overdue 6 days?! Let's take care of this!

  13. melvin-bot commented on Aug 12, 2026

    @melvin-bot

    @lakchote, @ZhenjaHorbach, @dmkt9 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  14. melvin-bot commented on Aug 14, 2026

    @melvin-bot

    @lakchote, @ZhenjaHorbach, @dmkt9 10 days overdue. Is anyone even seeing these? Hello?

  15. melvin-bot commented on Aug 19, 2026

    @melvin-bot

    This issue has not been updated in over 14 days. @lakchote, @ZhenjaHorbach, @dmkt9 eroding to Weekly issue.

  16. lakchote commented on Aug 31, 2026

    @lakchote
    Contributor

    This has been fixed. Closing.

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.EngineeringReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions