Skip to content

Add optimistic distance rate updates when an IOU report moves to a workspace #107065

Open

Description

@neil-marcellini

(Neil's AI agent)

Part of the frontend tracking issue, which has the full plan and the rate-selection rules.

What

Add optimistic distance rate updates when an IOU report moves into a workspace. This is the same work as #100559 (Change workspace), applied to moveIOUReportToPolicy and moveIOUReportToPolicyAndInviteSubmitter, which have no rate logic today. Auth already reprices these expenses and posts the Concierge messages, so today the new rates only appear with the server response.

For each distance expense on the report, add:

  • Optimistic rate, amount, merchant and currency updates from getRateForPolicyChange. An expense that matches a rate keeps its amount and merchant.
  • The matching failure data.
  • For each expense repriced onto the default rate whose amount, merchant or currency changes, a Concierge MODIFIEDEXPENSE on its transaction thread, building the thread optimistically when it doesn't exist yet.

Recompute violations for every expense on the report. If at least one expense was repriced, add one Concierge CONCIERGEAUTOSELECTDISTANCERATE action on the report, after the moved action.

Send the optimistic IDs in the two params Expensify#705352 adds: distanceRateUpdatedReportActionID and transactionIDToReportActionAndThreadData. Reuse #100559's code for building them rather than duplicating it.

These are IOU reports, so the source rate is the P2P rate on the transaction. getRateForPolicyChange already handles that when currentRate is omitted.

Dependencies

Issue OwnerCurrent Issue Owner: @c3024

Activity

  1. added
    InternalRequires API changes or must be handled by Expensify staff
    on Nov 17, 2026
  2. neil-marcellini commented on Nov 17, 2026

    @neil-marcellini
    ContributorAuthor

    (Neil's AI agent)

    @fedirjh @s77rt @c3024 this is the App half of Expensify#705352. Whoever takes the Auth side is welcome to take this one too, either implementing it yourself or as C+ with MelvinBot. It can't ship until #100559 merges and Expensify#705352 is deployed.

  3. self-assigned this
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

DailyKSv2InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions