Skip to content

Commit 03db3fc

Browse files
MelvinBotrojiphil
andcommitted
Clear transactionThreadReportID in failure data when optimistically created
Since transactionThreadReportID is optimistically added to the transaction on bulk edit, it needs to be explicitly cleared on failure so a stale thread reference doesn't persist when the server never created the thread. Co-authored-by: Roji Philip <rojiphil@users.noreply.github.com>
1 parent 1e161d6 commit 03db3fc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/libs/actions/IOU/BulkEdit.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,9 @@ function updateMultipleMoneyRequests({
554554
...transaction,
555555
pendingFields: clearedPendingFields,
556556
errorFields,
557+
// Clear the optimistically added transactionThreadReportID so it doesn't
558+
// persist after a failed request — the server never created this thread.
559+
...(didCreateThreadInThisIteration && transactionThreadReportID ? {transactionThreadReportID: null} : {}),
557560
},
558561
});
559562

0 commit comments

Comments
 (0)