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
[Due for payment 2025-09-17] [$250] Distance - Waypoints are not cleared after relaunching app #69450
However, when we call removeDraftTransactions after reopening the app, the list is empty. It's because inline require is enabled, and this Onyx.connect is only executed once we call the code from Transaction.ts.
🚨 Edited by proposal-police: This proposal was edited at 2025-09-02 15:49:20 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Waypoints are not cleared after relaunching app
What is the root cause of that problem?
The issue was caused by the Onyx.connect() callback in for allTransactionDrafts not being executed until the code is actually imported. When removeDraftTransactions() was called during app startup, the allTransactionDrafts variable was still empty because the Onyx.connect() callback hadn't been triggered yet.
What changes do you think we should make in order to solve the problem?
We should fix the problematic function which is removeDraftTransactions. If no draft transactions in memory (likely due to inline require), we should use Onyx.connectWithoutView to get the current state from storage
By doing this way, we can make sure all the place that trigger removeDraftTransactions would work as expected
Note: We can add new prop in removeDraftTransactions to only use connectWithoutView for the clear draft txn data in App.tsx
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
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.
Thank you all for the proposals. @bernhardoj — you correctly identified the root cause, but I think your solution complicates the API surface and risking missed callers of startMoneyRequest or clearMoneyRequest. Thanks for the effort.
I prefer the fix that refreshes draft transactions from storage using Onyx.connectWithoutView before clearing them.
No new PR is created due to the issue being resolved elsewhere
I think typically we still pay out issues even if they were "magically" fixed somewhere else if a contributor makes a proposal and writes code that's reviewed by a C+. However, this one resulted in a regression and was reverted anyway. Confirming with the team how to handle: https://expensify.slack.com/archives/C01SKUP7QR0/p1757942350600449
Activity
melvin-bot commentedon Aug 28, 2025
Triggered auto assignment to @greg-schroeder (
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.bernhardoj commentedon Aug 28, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The distance waypoints are not cleared when reopen it after closing the app.
What is the root cause of that problem?
When we press the create expense option, we call
removeDraftTransactionsto remove all the draft transactions.App/src/libs/actions/IOU.ts
Lines 1020 to 1027 in 10f648b
It gets the list of draft transaction from the Onyx.connect
App/src/libs/actions/TransactionEdit.ts
Lines 100 to 113 in 10f648b
App/src/libs/actions/Transaction.ts
Lines 1166 to 1168 in 10f648b
App/src/libs/actions/Transaction.ts
Lines 77 to 85 in 10f648b
However, when we call
removeDraftTransactionsafter reopening the app, the list is empty. It's because inline require is enabled, and this Onyx.connect is only executed once we call the code from Transaction.ts.App/src/libs/actions/Transaction.ts
Lines 77 to 85 in 10f648b
What changes do you think we should make in order to solve the problem?
We need to pass the list of draft transaction keys using useOnyx.
In FloatingActionButtonAndPopover,
then pass it down to
startMoneyRequest>clearMoneyRequest>removeDraftTransactions.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
lorretheboy commentedon Aug 28, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-09-02 15:49:20 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Waypoints are not cleared after relaunching app
What is the root cause of that problem?
The issue was caused by the Onyx.connect() callback in for
allTransactionDraftsnot being executed until the code is actually imported. When removeDraftTransactions() was called during app startup, theallTransactionDraftsvariable was still empty because the Onyx.connect() callback hadn't been triggered yet.App/src/libs/actions/Transaction.ts
Lines 77 to 84 in 3e3a327
So that this function is not working
App/src/libs/actions/TransactionEdit.ts
Line 100 in 5da0d43
What changes do you think we should make in order to solve the problem?
We should fix the problematic function which is
removeDraftTransactions. If no draft transactions in memory (likely due to inline require), we should use Onyx.connectWithoutView to get the current state from storageBy doing this way, we can make sure all the place that trigger
removeDraftTransactionswould work as expectedNote: We can add new prop in
removeDraftTransactionsto only useconnectWithoutViewfor the clear draft txn data in App.tsxWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
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.
melvin-bot commentedon Sep 2, 2025
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
melvin-bot commentedon Sep 2, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (
External)brunovjk commentedon Sep 2, 2025
Thank you all for the proposals.
@bernhardoj — you correctly identified the root cause, but I think your solution complicates the API surface and risking missed callers of
startMoneyRequestorclearMoneyRequest. Thanks for the effort.I prefer the fix that refreshes draft transactions from storage using
Onyx.connectWithoutViewbefore clearing them.I think we can go with @lorretheboy's proposal
🎀 👀 🎀 C+ reviewed
39 remaining items
lorretheboy commentedon Sep 14, 2025
@brunovjk I think we can ping QA to re-verify this bug again to see if it is still reproducible
brunovjk commentedon Sep 15, 2025
@greg-schroeder or @Julesssss can you help us retest this issue? Thank you :D
greg-schroeder commentedon Sep 15, 2025
I pinged for a retest: https://expensify.slack.com/archives/C9YU7BX5M/p1757937855025209
brunovjk commentedon Sep 15, 2025
Thank you.
IuliiaHerets commentedon Sep 15, 2025
@greg-schroeder Issue not repro on Android and iOS app
https://github.com/user-attachments/assets/d265325e-681e-4362-9371-6d18c426f2d3
https://github.com/user-attachments/assets/5f6afda2-ecd5-4392-9048-871e39de2c55
greg-schroeder commentedon Sep 15, 2025
Seems this was resolved after all
greg-schroeder commentedon Sep 15, 2025
Hmm. We need to figure out how to handle payment for this issue. Timeline:
I think typically we still pay out issues even if they were "magically" fixed somewhere else if a contributor makes a proposal and writes code that's reviewed by a C+. However, this one resulted in a regression and was reverted anyway. Confirming with the team how to handle: https://expensify.slack.com/archives/C01SKUP7QR0/p1757942350600449
greg-schroeder commentedon Sep 15, 2025
Let's go with $125 here
greg-schroeder commentedon Sep 15, 2025
Sent updated offer to @lorretheboy
lorretheboy commentedon Sep 15, 2025
Approved it. Thanks @greg-schroeder
greg-schroeder commentedon Sep 15, 2025
Payment summary:
Contributor: @lorretheboy - $125 - Upwork
C+: @brunovjk - $125 - ND manual request
brunovjk commentedon Sep 15, 2025
Requested, thank you @greg-schroeder
Julesssss commentedon Sep 15, 2025
Thanks Greg, I agree
trjExpensify commentedon Sep 15, 2025
approved $125 for @brunovjk. 👍