Skip to content

[$500] Split Bill - Group members disappeared in a split bill when make second split bill in a row #33518

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number:
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:

Issue found when executing PR #29996

Action Performed:

  1. Open https://staging.new.expensify.com/
  2. Create a group chat with about 3-4 members
  3. Send a message to the chat
  4. Create a split bill with all members
  5. Create a second split bill in a row with the same members

Expected Result:

User should be able to make a two split bills in a row in a group chat

Actual Result:

Group members disappeared in a split bill when make second split bill in a row

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6324217_1703269813154.Recording__32.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d3ed805fe8e7116d
  • Upwork Job ID: 1738267582378926080
  • Last Price Increase: 2024-01-19
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 0
Issue OwnerCurrent Issue Owner: @abdulrahuman5196

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 22, 2023
  2. melvin-bot commented on Dec 22, 2023

    @melvin-bot
  3. changed the title [-] Split Bill - Group members disappeared in a split bill when make second split bill in a row[/-] [+][$500] Split Bill - Group members disappeared in a split bill when make second split bill in a row[/+] on Dec 22, 2023
  4. melvin-bot commented on Dec 22, 2023

    @melvin-bot

    Triggered auto assignment to @alexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 22, 2023
  6. melvin-bot commented on Dec 22, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  7. melvin-bot commented on Dec 22, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External)

  8. adriancova commented on Dec 22, 2023

    @adriancova
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Draft view for a new split bill is getting reset when creating a second split bill right after another.

    What is the root cause of that problem?

    I've managed to reproduce the issue by throttling my network, root cause is that part of the onyx successData is setting TRANSACTION_DRAFT as null.

    {
          onyxMethod: Onyx.METHOD.MERGE,
           key: `${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${CONST.IOU.OPTIMISTIC_TRANSACTION_ID}`,
           value: null,
    }
    

    So when the network call finishes and we got a new split bill in progress it gets reset.

    What changes do you think we should make in order to solve the problem?

    Remove the TRANSACTION_DRAFT merge to null from the successData inside IOU.createSplitsAndOnyxData method

    What alternative solutions did you explore? (Optional)

    Instead of removing the transaction_draft, we can move it to the optimisticData, though it shouldn't be necessary since the transaction draft view is already cleaned up after submitting it.

    Edit: removed reminder text

  9. alexpensify commented on Dec 23, 2023

    @alexpensify
    Contributor

    @abdulrahuman5196 - when you get a chance, can you review if this proposal will fix this issue? Thanks!

    Heads up, I will be offline from Friday, December 22, to Thursday, January 4, 2024. I will not be actively watching over this GitHub during that period. If anything urgent is needed here, please ask for help in the #expensify-open-source Slack Room-- thanks!

  10. dukenv0307 commented on Dec 25, 2023

    @dukenv0307
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Group members disappeared in a split bill when make second split bill in a row

    What is the root cause of that problem?

    We clear the transactionDraft in successData here. So if we create another split bill before the API is complete, this is removed and then group members are cleared.

    value: null,

    What changes do you think we should make in order to solve the problem?

    1. I think instead of using the const transactionID when creating a new request, we can generate a random transactionID by using NumberUtils.rand64() and then use it as the ID of the new transaction when we confirm to create it. This is the same way as we do for reportID.

    ROUTES.MONEY_REQUEST_CREATE.getRoute(CONST.IOU.TYPE.REQUEST, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, ReportUtils.generateReportID()),

    And then we can replace CONST.IOU.OPTIMISTIC_TRANSACTION_ID with this transactionID.

    1. To clear the old draft transaction, when we initialize the transaction draft we can add an extra field like expired which is 30 days (the days can be discussed in the PR) after the current date. Then whenever we open the app, we will call clearOldTransactionDraft function. This function will clear all transactions draft which has expired is less than the current date.

    function startMoneyRequest_temporaryForRefactor(reportID, isFromGlobalCreate, iouRequestType = CONST.IOU.REQUEST_TYPE.MANUAL) {

    Here is the test branch: https://github.com/dukenv0307/App/tree/fix/33518

    What alternative solutions did you explore? (Optional)

    For point 2, we can always clear all transaction drafts whenever we open the App. Although it's not good for the case user is starting the money request flow in another tab, this case is rare and we don't need to take care of this so much.

  11. melvin-bot commented on Dec 27, 2023

    @melvin-bot

    @alexpensify, @abdulrahuman5196 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  12. 99 remaining items

  13. adriancova commented on Feb 20, 2024

    @adriancova
    Contributor

    Hey guys, I'll send a pr in a couple of hours. But it seems I can no longer apply to the upwork job, it's showing as "no longer available". will that be an issue? @dangrous

  14. dangrous commented on Feb 21, 2024

    @dangrous
    Contributor

    We can recreate it as needed, I know upwork is weird sometimes! cc @alexpensify

  15. alexpensify commented on Feb 23, 2024

    @alexpensify
    Contributor

    I'll need to create a new job in Upwork but will do so when the automation flags for payment kicks in. I've noted I need to create a new job.

  16. alexpensify commented on Feb 28, 2024

    @alexpensify
    Contributor

    I'm aware that this one is in staging now and will watch out for it to go to production

  17. abdulrahuman5196 commented on Mar 5, 2024

    @abdulrahuman5196
    Contributor

    The PR that introduced the bug has been identified. Link to the PR:
    The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
    A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

    Not a regression. Seems to be a bug for sometime.

    Determine if we should create a regression test for this bug.
    If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

    No. Minor case which is hard to reproduce.

  18. adriancova commented on Mar 5, 2024

    @adriancova
    Contributor

    Hey again

    sorry, first time contributor here. is there something else I need to do on my end?

  19. alexpensify commented on Mar 5, 2024

    @alexpensify
    Contributor

    @adriancova - no action is needed here. @abdulrahuman5196 confirmed that this PR didn't cause regression. The only remaining action is the payment process. Tomorrow marks the 7-day mark, and I can start the payment process then.

  20. alexpensify commented on Mar 6, 2024

    @alexpensify
    Contributor

    Here is the payment summary:

    • External issue reporter - N/A
    • Contributor that fixed the issue - @adriancova $500
    • Contributor+ that helped on the issue and/or PR - @abdulrahuman5196 $500

    Upwork Job: https://www.upwork.com/jobs/~01d3ed805fe8e7116d

    Extra Notes regarding payment: @adriancova - I'm having trouble finding you on Upwork. Can you share your Upwork profile URL and I can try to find you that way? Thanks!

  21. adriancova commented on Mar 7, 2024

    @adriancova
    Contributor

    Hey @alexpensify, sure I just changed the url to make it easier to find:
    https://www.upwork.com/freelancers/adriancova

    Let me know if I can help with anything else, and thank you!

  22. alexpensify commented on Mar 7, 2024

    @alexpensify
    Contributor

    Thanks, I had to spin up a new job but invited you to it here:

    https://www.upwork.com/jobs/~01696e82885325d5bd

    Please accept in Upwork and I can complete the next steps. Thanks!

  23. alexpensify commented on Mar 7, 2024

    @alexpensify
    Contributor

    Ok, all set here-- everyone has been paid in Upwork.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions