Skip to content

[Due for payment 2025-11-03] [$125] Do not create optimistic transaction thread report on RequestMoney #58828

Closed
7 of 7 issues completed

Description

@iwiznia

Related to https://github.com/Expensify/Expensify/issues/433103

Conversation https://expensify.slack.com/archives/C08CZDJFJ77/p1742395185178209

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.

Issue OwnerCurrent Issue Owner: @hungvu193 / @abekkala
Issue OwnerCurrent Issue Owner: @VickyStash

Activity

  1. VickyStash commented on Mar 20, 2025

    @VickyStash
    Contributor

    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.

  2. VickyStash commented on Mar 21, 2025

    @VickyStash
    Contributor

    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:

    1. I create 3 expenses in 1-1 chat. This way I have a report with several transaction.
    2. I open one of the transactions -> transaction thread report is created for 1 out of 3 transactions.
    3. 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.

  3. VickyStash commented on Mar 21, 2025

    @VickyStash
    Contributor

    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.

    Image

    @iwiznia @mountiny Was it discussed before?

  4. VickyStash commented on Mar 21, 2025

    @VickyStash
    Contributor

    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
  5. mountiny commented on Mar 21, 2025

    @mountiny
    Contributor

    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.

  6. VickyStash commented on Mar 21, 2025

    @VickyStash
    Contributor

    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.

  7. iwiznia commented on Mar 21, 2025

    @iwiznia
    ContributorAuthor

    Is it the expected behavior?

    No.

    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.

  8. VickyStash commented on Mar 21, 2025

    @VickyStash
    Contributor

    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

  9. iwiznia commented on Mar 21, 2025

    @iwiznia
    ContributorAuthor

    Maybe we can assume that if there are no actions is because we will optimistically create the transaction thread?

  10. VickyStash commented on Mar 21, 2025

    @VickyStash
    Contributor

    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?

  11. 302 remaining items

  12. sakluger commented on Nov 6, 2025

    @sakluger
    Contributor

    Can you chill now Melvin, please?

  13. sakluger commented on Nov 6, 2025

    @sakluger
    Contributor

    @hungvu193 does $500 total feel fair to you?

    Then for the following:

    I think there will be 1 more issue to remove the beta.

    Are you saying we should wait for that issue before closing this again? Do you have a link to it?

  14. sakluger commented on Nov 10, 2025

    @sakluger
    Contributor

    I'll be OOO on Monday and Tuesday. @hungvu193 let me know what you think about my comment above, I can handle on Wednesday.

  15. hungvu193 commented on Nov 11, 2025

    @hungvu193
    Contributor

    Are you saying we should wait for that issue before closing this again? Do you have a link to it?

    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.

    @hungvu193 does $500 total feel fair to you?

    Due to the effort spent on these PRs, do you think it is worth $750 (including the next PR to remove betas)?

  16. sakluger commented on Nov 12, 2025

    @sakluger
    Contributor
  17. sakluger commented on Nov 12, 2025

    @sakluger
    Contributor

    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?

  18. iwiznia commented on Nov 13, 2025

    @iwiznia
    ContributorAuthor

    We don't need an issue, but if we do, you can create it too.

  19. sakluger commented on Nov 14, 2025

    @sakluger
    Contributor

    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:

  20. hungvu193 commented on Nov 14, 2025

    @hungvu193
    Contributor

    This issue has been always in progress since then so I haven't requested any payment yet 😄

  21. garrettmknight commented on Nov 21, 2025

    @garrettmknight
    Contributor

    $750 approved for @hungvu193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringReviewingHas a PR in reviewTaskWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions