-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2023-06-30] [$2000] Web - Split - The unselected members are selected if you click on Amount field and return back (Works well if you click on description and return back) #17662
Comments
Triggered auto assignment to @conorpendergrast ( |
Bug0 Triage Checklist (Main S/O)
|
Reproduced, thanks! |
Job added to Upwork: https://www.upwork.com/jobs/~014c6f23446b0fe33b |
Current assignee @conorpendergrast is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Triggered auto assignment to @PauloGasparSv ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Web - Split - The unselected members are selected if you click on the Amount field and return back (Works well if you click on description and return back) What is the root cause of that problem?When the user clicks the amount and comes back, App/src/components/MoneyRequestConfirmationList.js Lines 88 to 90 in 1cd304c
This problem does not happen when clicking the description and return back because when clicking the description, MoneyRequestConfirmationList Component will not be unmounted
What changes do you think we should make in order to solve the problem?We could create a new field App/src/components/MoneyRequestConfirmationList.js Lines 88 to 90 in 1cd304c
We will get splitBillParticipant_ReportID from ONYX and set selected field (true/ false) for all participants based on splitBillParticipant_ReportID
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.When we unselect a participant from spilt bill, then navigate to amount page and come back then the unselected participant is again selected. What is the root cause of that problem?We are not updating state when any participant is removed from the selected list What changes do you think we should make in order to solve the problem?We should update the selected participants list whenever a participant is selected/unselected. I would suggest these changes
componentDidUpdate(prevProps,prevState) {
if(!_.isEqual(this.state.participants, prevState.participants)) {
this.props.onParticipantsChange(this.state.participants)
}
}
const formattedParticipants = _.map(this.getParticipantsWithAmount(props.participants), participant => ({
...participant, selected: true,
})); but we should do it like this (selected should be set first, and will be overridden if the participants array has the 'selected' field already set) const formattedParticipants = _.map(this.getParticipantsWithAmount(props.participants), participant => ({
selected: true,
...participant,
}));
onParticipantsChange={(updatedParticipants) => {
setSelectedOptions([
..._.filter(selectedOptions, email => props.currentUserPersonalDetails.login === email.login),
...updatedParticipants,
])
}} DemoScreen.Recording.2023-04-20.at.3.00.42.PM.movWhat alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.All participants selected state is lost when we navigate to edit amount page. What is the root cause of that problem?We are rendering conditionally each screen (amount, participants, and confirmation), while the description screen is a separate stack screen. When we navigate from confirmation page to amount page, confirmation page will be unmount, thus the state (selected participants) is lost and everyone becomes selected again. App/src/pages/iou/MoneyRequestModal.js Lines 414 to 447 in 1cd304c
What changes do you think we should make in order to solve the problem?My solution is basically very similar with @huzaifa-99, but because I have spent my time finding the solution, I will still share it. Currently, we store the selected participants as a state inside App/src/components/MoneyRequestConfirmationList.js Lines 88 to 94 in 1cd304c
App/src/components/MoneyRequestConfirmationList.js Lines 170 to 171 in 1cd304c
We can also remove getParticipantsWithoutAmount because it won't do nothing anymore since participants won't have descriptiveText by default.
All To notify App/src/components/MoneyRequestConfirmationList.js Lines 232 to 240 in 1cd304c
Two last things left. We can look here that we map the list and give it a App/src/pages/iou/MoneyRequestModal.js Lines 118 to 122 in 1cd304c
Last, we should reset all But it's currently not possible because we have this bug #17637. So, we should fix that first before continue this. What alternative solutions did you explore? (Optional)Honestly, I think it would be much cleaner to have this 3 pages (amount, participants, confirmation) have their own stack screen. I don't know the reason why we put all these 3 "pages" inside |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
Hmm, I am not sure about this. We don't clear the description text on the confirmation screen when going back to the amount page so I think we also shouldn't reset the selected value. Also I think it's pretty normal to use the back button when you wanna go back to edit something and it will not be a good experience to see that the changes you made are gone. |
I prefer @bernhardoj's proposal more because of the code refactor. 🎀👀🎀 C+ reviewed cc: @PauloGasparSv |
I agree with you @thesahindia! So I'm assigning them here : )
Hey @bernhardoj that's a great catch. Can this be worked in parallel while that other bug is fixed? I'm not 100% sure if we should put this on HOLD until that's fixed. |
📣 @bernhardoj You have been assigned to this job by @PauloGasparSv! |
@PauloGasparSv, what's your opinion about #17662 (comment) |
Ah, btw I agree with that #17662 (comment) as we also save description. |
Accepted! Btw, can we ask for a higher bounty as the PR is quite big and solves other issues too? 😄 @s77rt Do you agree? |
I will escalate that request to discuss in Slack! |
Discussing with C+ and Expensifiers in the C+ channel here |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.31-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-06-30. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Regression Test Proposal
|
Upwork job price has been updated to $2000 |
From that discussion, we agree with raising the price to $2000. I've done that now, and it's also time to pay so that's nice |
Regression test request: https://github.com/Expensify/Expensify/issues/296776 |
All paid, contracts ended, all done. Closing out, thanks everyone |
Thanks! |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
The removed member should not be selected on clicking amount field in a similar way how the removed member is not selected when clicked on the description
Actual Result:
The removed member is selected again if you click on amount field unlike the description field
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.1.3
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Notes/Photos/Videos: Any additional supporting documentation
error-2023-04-18_19.55.50.mp4
Recording.2522.mp4
Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681827527469619
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: