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
- Update the backend to reliably include
reportID on all IOU actions.
- 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
Background
#93881 restored a temporary client-side fallback for resolving the report an
IOUaction 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?.reportIDfallback under the assumption thatreportAction.reportIDalways equals the IOU/expense report ID. The backend does not reliably includereportIDonIOUactions, so resolving purely fromreportAction.reportIDbroke editability (admins/managers could not edit fields on submitted expense reports — see #93864).What needs to happen
reportIDon allIOUactions.canEditMoneyRequest(src/libs/ReportUtils.ts)canEditFieldOfMoneyRequest(src/libs/ReportUtils.ts)canEditReportAction(src/libs/ReportUtils.ts)useGetIOUReportFromReportAction(src/hooks/useGetIOUReportFromReportAction.ts)IOUReportIDfield fromOriginalMessageIOU(src/types/onyx/OriginalMessage.ts)Search for the comment
Temporary fallback to originalMessage.IOUReportIDto find all sites.Related