Skip to content

Remove temporary IOUReportID fallback once backend reliably sends reportID on IOU actions #93882

Description

@youssef-lr

Background

#93881 restored a temporary client-side fallback for resolving the report an IOU action belongs to:

// Temporary fallback to originalMessage.IOUReportID while the backend is updated to reliably send reportID on IOU actions.

This was needed because #87530 removed the originalMessage?.IOUReportID ?? reportAction?.reportID fallback under the assumption that reportAction.reportID always equals the IOU/expense report ID. The backend does not reliably include reportID on IOU actions, so resolving purely from reportAction.reportID broke editability (admins/managers could not edit fields on submitted expense reports — see #93864).

What needs to happen

  1. Update the backend to reliably include reportID on all IOU actions.
  2. Once that ships and propagates, remove the temporary fallback from NewDot:
    • canEditMoneyRequest (src/libs/ReportUtils.ts)
    • canEditFieldOfMoneyRequest (src/libs/ReportUtils.ts)
    • canEditReportAction (src/libs/ReportUtils.ts)
    • useGetIOUReportFromReportAction (src/hooks/useGetIOUReportFromReportAction.ts)
    • Remove the re-added IOUReportID field from OriginalMessageIOU (src/types/onyx/OriginalMessage.ts)

Search for the comment Temporary fallback to originalMessage.IOUReportID to find all sites.

Related

Metadata

Metadata

Assignees

Labels

InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions