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-11-03] [$125] Do not create optimistic transaction thread report on RequestMoney #58828
The main goal of the project is to stop creating the transaction thread reports optimistically and instead have those be created when they are needed.
I have already deployed the PRs in the backend that make it so that we do not create the report in RequestMoney api request if we don't pass a transactionThreadReport and have this draft PR #58523 that stops sending it.
Re-posting updates for today:
I've opened a new Draft PR with updates, did a brief testing and it works as expected - no transaction thread is created.
Tomorrow I'm going to test my PR over the PR that creates transactionThread when needed, also I'm going to do some testing with offline flows to check how it works.
Today, during testing, I have found some issues related to not creating optimistic transaction threads.
Through the app, we have a lot of logic relying on checking if the report has only one transaction thread: isOneTransactionThread getOneTransactionThreadReportID
Example, of side effects:
I create 3 expenses in 1-1 chat. This way I have a report with several transaction.
I open one of the transactions -> transaction thread report is created for 1 out of 3 transactions.
Then, if I from the chat try to open the expenses overview, the app thinks that I have one-transaction-report and just shows that specific transaction thread (see the video below).
bug_example1.mp4
I'll need to look through every case in the app where it checks for one-transaction-thread and think about the alternative, maybe checking for transactions on its own.
I'm not sure that we can replace all of the one-transaction-thread checks (see my message above) through the app with checks for just transactions since transactions are not returned in the OpenApp response.
The OpenApp will definitely not return all the transactions for you, it probably should not return any once we have all the violations migrated to Auth. OpenReport will load those you need for the report.
The OpenApp will definitely not return all the transactions for you, it probably should not return any once we have all the violations migrated to Auth. OpenReport will load those you need for the report.
Okay, that means the app doesn't have information about report transactions before the report is opened.
Right now, the app uses transaction threads to identify the number of transactions in the report and what logic to apply.
If we update the app logic not to create transaction threads right away, which data can I use to handle some checks in case I haven't opened the report?
For example, 3 weeks ago some updates were merged, they includes checking for one-transaction-tread reports from the LHN level.
Right now, the app uses transaction threads to identify the number of transactions in the report and what logic to apply.
If we update the app logic not to create transaction threads right away, which data can I use to handle some checks in case I haven't opened the report?
I don't think I am following, I see that getOneTransactionThreadReportID only uses the reportActions not the transactions.
I don't think I am following, I see that getOneTransactionThreadReportID only uses the reportActions not the transactions.
I mean since we won't create transaction threads right away, all of the checks that use getOneTransactionThreadReportID/isOneTransactionThread won't work as expected
Okay, it seems like I was able to fix the one-thread-transactions checks just by suppressing the action.childReportID checks inside getOneTransactionThreadReportID function. I've tested and it stills works as expected thanks to other checks we have there.
Thank you for thoughts sharing! 🙌
@iwiznia What about the offline flow expected behaviour? What should users see if they are offline -> create expense -> try to open a transaction thread?
This issue is a little funky - there have already been multiple payment summaries posted over the last 6 months. @hungvu193, I'm not sure if you have already requested payment on any of the previous payment summaries, so I will list them here so we can double-check. Total payment should be $750 - if we've paid any of the previous amounts on this issue, we should deduct those amounts.
Activity
VickyStash commentedon Mar 20, 2025
Re-posting updates for today:
I've opened a new Draft PR with updates, did a brief testing and it works as expected - no transaction thread is created.
Tomorrow I'm going to test my PR over the PR that creates transactionThread when needed, also I'm going to do some testing with offline flows to check how it works.
VickyStash commentedon Mar 21, 2025
Today, during testing, I have found some issues related to not creating optimistic transaction threads.
Through the app, we have a lot of logic relying on checking if the report has only one transaction thread:
isOneTransactionThread
getOneTransactionThreadReportID
Example, of side effects:
bug_example1.mp4
I'll need to look through every case in the app where it checks for one-transaction-thread and think about the alternative, maybe checking for transactions on its own.
VickyStash commentedon Mar 21, 2025
I'm not sure that we can replace all of the
one-transaction-threadchecks (see my message above) through the app with checks for just transactions since transactions are not returned in theOpenAppresponse.@iwiznia @mountiny Was it discussed before?
VickyStash commentedon Mar 21, 2025
Another thing is offline behavior.
When I test my updates over the PR that creates a transaction thread when needed , in the offline opening, the transaction thread gives endless loading.
Is it the expected behavior?
offline_example2.mp4
mountiny commentedon Mar 21, 2025
The OpenApp will definitely not return all the transactions for you, it probably should not return any once we have all the violations migrated to Auth. OpenReport will load those you need for the report.
VickyStash commentedon Mar 21, 2025
Okay, that means the app doesn't have information about report transactions before the report is opened.
Right now, the app uses transaction threads to identify the number of transactions in the report and what logic to apply.
If we update the app logic not to create transaction threads right away, which data can I use to handle some checks in case I haven't opened the report?
For example, 3 weeks ago some updates were merged, they includes checking for one-transaction-tread reports from the LHN level.
iwiznia commentedon Mar 21, 2025
No.
I don't think I am following, I see that
getOneTransactionThreadReportIDonly uses thereportActionsnot the transactions.VickyStash commentedon Mar 21, 2025
I mean since we won't create transaction threads right away, all of the checks that use
getOneTransactionThreadReportID/isOneTransactionThreadwon't work as expectediwiznia commentedon Mar 21, 2025
Maybe we can assume that if there are no actions is because we will optimistically create the transaction thread?
VickyStash commentedon Mar 21, 2025
Okay, it seems like I was able to fix the one-thread-transactions checks just by suppressing the action.childReportID checks inside
getOneTransactionThreadReportIDfunction. I've tested and it stills works as expected thanks to other checks we have there.Thank you for thoughts sharing! 🙌
@iwiznia What about the offline flow expected behaviour? What should users see if they are offline -> create expense -> try to open a transaction thread?
302 remaining items
sakluger commentedon Nov 6, 2025
Can you chill now Melvin, please?
sakluger commentedon Nov 6, 2025
@hungvu193 does $500 total feel fair to you?
Then for the following:
Are you saying we should wait for that issue before closing this again? Do you have a link to it?
sakluger commentedon Nov 10, 2025
I'll be OOO on Monday and Tuesday. @hungvu193 let me know what you think about my comment above, I can handle on Wednesday.
hungvu193 commentedon Nov 11, 2025
We haven't created issue for it yet. Not sure if we want to remove beta as a scope of this issue. I think we should.
Due to the effort spent on these PRs, do you think it is worth $750 (including the next PR to remove betas)?
sakluger commentedon Nov 12, 2025
Checking on both points in Slack: https://expensify.slack.com/archives/C01SKUP7QR0/p1762965916553329?thread_ts=1762446562.604609&cid=C01SKUP7QR0
sakluger commentedon Nov 12, 2025
Hey @hungvu193, we can do $750 total.
Regarding removing the beta, who should create that issue? @VickyStash or @iwiznia, can you help create an issue to remove the beta?
iwiznia commentedon Nov 13, 2025
We don't need an issue, but if we do, you can create it too.
sakluger commentedon Nov 14, 2025
This issue is a little funky - there have already been multiple payment summaries posted over the last 6 months. @hungvu193, I'm not sure if you have already requested payment on any of the previous payment summaries, so I will list them here so we can double-check. Total payment should be $750 - if we've paid any of the previous amounts on this issue, we should deduct those amounts.
Payment Summary
Previous payment summaries on this issue:
hungvu193 commentedon Nov 14, 2025
This issue has been always in progress since then so I haven't requested any payment yet 😄
garrettmknight commentedon Nov 21, 2025
$750 approved for @hungvu193