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
[$500] Split Bill - Group members disappeared in a split bill when make second split bill in a row #33518
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:
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
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.
@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!
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.
What changes do you think we should make in order to solve the problem?
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.
And then we can replace CONST.IOU.OPTIMISTIC_TRANSACTION_ID with this transactionID.
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.
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.
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
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.
@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.
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!
Activity
melvin-bot commentedon Dec 22, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01d3ed805fe8e7116d
[-] 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[/+]melvin-bot commentedon Dec 22, 2023
Triggered auto assignment to @alexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Dec 22, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Dec 22, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (
External)adriancova commentedon Dec 22, 2023
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.
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.createSplitsAndOnyxDatamethodWhat 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
alexpensify commentedon Dec 23, 2023
@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!
dukenv0307 commentedon Dec 25, 2023
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
transactionDraftinsuccessDatahere. So if we create another split bill before the API is complete, this is removed and then group members are cleared.App/src/libs/actions/IOU.js
Line 1235 in 7b836cf
What changes do you think we should make in order to solve the problem?
transactionIDwhen creating a new request, we can generate a randomtransactionIDby usingNumberUtils.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 forreportID.App/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js
Line 204 in 7b836cf
And then we can replace
CONST.IOU.OPTIMISTIC_TRANSACTION_IDwith this transactionID.expiredwhich is 30 days (the days can be discussed in the PR) after the current date. Then whenever we open the app, we will callclearOldTransactionDraftfunction. This function will clear all transactions draft which hasexpiredis less than the current date.App/src/libs/actions/IOU.js
Line 140 in 8e2fb67
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.
melvin-bot commentedon Dec 27, 2023
@alexpensify, @abdulrahuman5196 Whoops! This issue is 2 days overdue. Let's get this updated quick!
99 remaining items
adriancova commentedon Feb 20, 2024
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
dangrous commentedon Feb 21, 2024
We can recreate it as needed, I know upwork is weird sometimes! cc @alexpensify
alexpensify commentedon Feb 23, 2024
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.
alexpensify commentedon Feb 28, 2024
I'm aware that this one is in staging now and will watch out for it to go to production
abdulrahuman5196 commentedon Mar 5, 2024
Not a regression. Seems to be a bug for sometime.
No. Minor case which is hard to reproduce.
adriancova commentedon Mar 5, 2024
Hey again
sorry, first time contributor here. is there something else I need to do on my end?
alexpensify commentedon Mar 5, 2024
@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.
alexpensify commentedon Mar 6, 2024
Here is the payment summary:
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!
adriancova commentedon Mar 7, 2024
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!
alexpensify commentedon Mar 7, 2024
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!
alexpensify commentedon Mar 7, 2024
Ok, all set here-- everyone has been paid in Upwork.