You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Track expense - Unable to delete track scan expense while scanning #64701
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Version Number: v9.1.70-2 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Exploratory Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Device used: Win 11/Chrome App Component: Money Requests
When a receipt is still scanning, the transaction thread report chatReportID property is undefined, while the parent Self DM report reportID is already available. Once scanning completes, both values become the same
Currently, we call deleteTrackExpense with undefined as the first parameter, so it cannot properly identify the Self DM chat report to update, causing the function to fail to trigger DeleteMoneyRequest
This behavior also occurs with distance expenses when the route is not defined, and when creating and deleting a manual expense in offline mode. When returning online, the report is not deleted because report?.chatReportID passes undefined
What changes do you think we should make in order to solve the problem?
Update the deleteTrackExpense call to use parentReport?.reportID instead of report?.chatReportID
This ensures that the correct Self DM chat report ID is always passed to deleteTrackExpense, regardless of whether the scan is still in progress or completed
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
report?.chatReportID is undefined because we don't add this in the optimistic data of the transaction thread report. If we open the transaction thread report, the OpenReport API will return chatReportID is the parent report
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Update buildOptimisticChatReport unit test to verify the chatReportID exists if parentReportID is not empty.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Track expense - Unable to delete track scan expense while scanning[/-][+][$250] Track expense - Unable to delete track scan expense while scanning[/+]on Jun 24, 2025
When a receipt is still scanning, the transaction thread report chatReportID property is undefined, while the parent Self DM report reportID is already available. Once scanning completes, both values become the same
@akinwale The chatReportID is missing in the optimistic data then we should fix this instead of using another field. Additionally, the chatReportID is always returned in the OpenReport API, no need to wait scanning completes
@akinwale The chatReportID is missing in the optimistic data then we should fix this instead of using another field. Additionally, the chatReportID is always returned in the OpenReport API, no need to wait scanning completes
@akinwale What do you think about that? Without doing a deeper dive it seems like a cleaner solution to me but I would like your take having reviewed them. Thanks!
@akinwale The chatReportID is missing in the optimistic data then we should fix this instead of using another field. Additionally, the chatReportID is always returned in the OpenReport API, no need to wait scanning completes
@akinwale What do you think about that? Without doing a deeper dive it seems like a cleaner solution to me but I would like your take having reviewed them. Thanks!
@amyevans Since the required value was already present as a different property, I thought it was preferable to go with the simpler option instead of having to update the optimistic data.
Coincidentally, it looks like the same idea was implemented independently, twice: #64632 and #63297.
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Activity
melvin-bot commentedon Jun 21, 2025
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.ryntgh commentedon Jun 21, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Track expense - Unable to delete track scan expense while scanning
What is the root cause of that problem?
When calling
deleteTrackExpense,report?.chatReportIDpassesundefinedfor scan expenses that are still processing in Self DMApp/src/components/MoneyRequestHeader.tsx
Lines 329 to 334 in 02e37d7
When a receipt is still scanning, the transaction thread report
chatReportIDproperty isundefined, while the parent Self DM reportreportIDis already available. Once scanning completes, both values become the sameCurrently, we call
deleteTrackExpensewithundefinedas the first parameter, so it cannot properly identify the Self DM chat report to update, causing the function to fail to triggerDeleteMoneyRequestThis behavior also occurs with distance expenses when the route is not defined, and when creating and deleting a manual expense in offline mode. When returning online, the report is not deleted because
report?.chatReportIDpassesundefinedWhat changes do you think we should make in order to solve the problem?
Update the
deleteTrackExpensecall to useparentReport?.reportIDinstead ofreport?.chatReportIDApp/src/components/MoneyRequestHeader.tsx
Lines 329 to 330 in 02e37d7
This ensures that the correct Self DM chat report ID is always passed to
deleteTrackExpense, regardless of whether the scan is still in progress or completedWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
Or we can use
report?.parentReportIDthelullabyy commentedon Jun 23, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
This expense isn't deleted
What is the root cause of that problem?
The
report?.chatReportIDisundefinedso this function do nothing.App/src/components/MoneyRequestHeader.tsx
Lines 329 to 334 in 02e37d7
report?.chatReportIDisundefinedbecause we don't add this in the optimistic data of the transaction thread report. If we open the transaction thread report, theOpenReportAPI will returnchatReportIDis the parent reportApp/src/libs/ReportUtils.ts
Line 7764 in b8ef627
App/src/libs/ReportUtils.ts
Lines 7702 to 7710 in b8ef627
What changes do you think we should make in order to solve the problem?
From what I see, the
chatReportIDis the same asparentReportID, then we can addchatReportIDwhen we create the optimistic chat report hereApp/src/libs/ReportUtils.ts
Lines 6916 to 6918 in b8ef627
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Update
buildOptimisticChatReportunit test to verify thechatReportIDexists ifparentReportIDis not empty.What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Track expense - Unable to delete track scan expense while scanning[/-][+][$250] Track expense - Unable to delete track scan expense while scanning[/+]melvin-bot commentedon Jun 24, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021937302120868579148
melvin-bot commentedon Jun 24, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale (
External)6 remaining items
thelullabyy commentedon Jun 27, 2025
@akinwale The
chatReportIDis missing in the optimistic data then we should fix this instead of using another field. Additionally, thechatReportIDis always returned in theOpenReportAPI, no need to wait scanning completesmelvin-bot commentedon Jun 30, 2025
@amyevans Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
amyevans commentedon Jun 30, 2025
@akinwale What do you think about that? Without doing a deeper dive it seems like a cleaner solution to me but I would like your take having reviewed them. Thanks!
ryntgh commentedon Jul 1, 2025
The issue is no longer reproducible, as it was fixed in this PR, which uses the exact same solution as my proposal
Would @akinwale and I be eligible for partial payment as compensation, based on this comment and this Slack thread?
akinwale commentedon Jul 1, 2025
Yes, 50% of the original price is due here for both the contributor and the C+ respectively.
cc @johncschuster
akinwale commentedon Jul 1, 2025
@amyevans Since the required value was already present as a different property, I thought it was preferable to go with the simpler option instead of having to update the optimistic data.
Coincidentally, it looks like the same idea was implemented independently, twice: #64632 and #63297.
johncschuster commentedon Jul 1, 2025
Payment Summary
Contributor: @ryntgh paid $125 via Upwork ✅
Contributor+: @akinwale due $125 via NewDot
@ryntgh please accept the offer above so I can pay that out for you!
ryntgh commentedon Jul 1, 2025
Offer accepted!
melvin-bot commentedon Jul 1, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
johncschuster commentedon Jul 2, 2025
@akinwale please go ahead and request payment here!
JmillsExpensify commentedon Jul 2, 2025
$125 approved for @akinwale