-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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-08-10] [$1000] Security - Still able to request Close Account when offline #23472
Comments
Triggered auto assignment to @MitchExpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.CloseAccount: Still able to request CloseAccount when offline. What is the root cause of that problem?In What changes do you think we should make in order to solve the problem?We should add a check inside useEffect(() => {
if (!props.network.isOffline || !isConfirmModalVisible) {
return;
}
setConfirmModalVisibility(false);
}, [props.network.isOffline, isConfirmModalVisible]); or just check for offline is just enough: useEffect(() => {
if (!props.network.isOffline) {
return;
}
setConfirmModalVisibility(false);
}, [props.network.isOffline]); What alternative solutions did you explore? (Optional)We should disable the |
ProposalPlease re-state the problem that we are trying to solve in this issue.The user can still request an account closure if the confirmation model was opened prior to being offline. What is the root cause of that problem?The Close button is disabled when going offline, however What changes do you think we should make in order to solve the problem?Similar to the
This adds a general implementation that can be used elsewhere and furthermore that is consistent with forms. What alternative solutions did you explore? (Optional)Alternatively, if it should be possible to delete an account while the user is offline, then the "Close account" button should be made available. |
ProposalPlease re-state the problem that we are trying to solve in this issue.User is still able to request CloseAccount when offline. What is the root cause of that problem?This is because the The Original Form button that calls the confirm button is disabled when offline, but this functionality is not present in the confirm Modal, which creates an inconsistency. What changes do you think we should make in order to solve the problem?We should simply add the functionality to the Confirm button in the To carry out this change, we would define an optional prop type (bool) here and pass App/src/components/FormAlertWithSubmitButton.js Lines 74 to 92 in 33ed167
What alternative solutions did you explore? (Optional)Alternatively we can dismiss the modal when offline, but this would create a jarring experice for user, as a modal is hidden without him doing anything (only his net is unstable) |
@marcochavezf cc'ing you as you worked on offline first. This seems expected to me based on offline first, do you agree? Basically the action is completed once you get back online which seems reasonable to me |
It does look like this should be expected, but since the original Form Button that calls the modal is disabled when offline we should probably expect similar behaviour with the modal. |
Yes, it's a consistency problem. If deleting it should be possible while offline (and has no implications to take into account), then the Close account button shouldn't be disabled. |
Oh this is an interesting issue, yeah seems to be expected, but imo we should disable the confirmation button in the modal when offline too. I think we'd need to bring it into the open-source channel for a broader discussion |
Ok cool, so it sounds like we are all agreed that the necessary fix here is to make sure the confirmation button in the modal is disabled when offline. I'll share in open-source and update the issue accordingly based on the feedback there |
Shared for more eyes here https://expensify.slack.com/archives/C01GTK53T8Q/p1690320979990179 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Security - Still able to request Close Account when offline What is the root cause of that problem?We are not disabling the ConfirmContent What changes do you think we should make in order to solve the problem?One thing that no previous proposal has mentioned is We should pass an enabledWhenOffline false value from CloseAccountPage to all the way to ConfirmContent. It's very important because we don't want to disable the confirm button in all other places where we are using this modal.
here
here App/src/components/ConfirmModal.js Line 71 in 5ba2178
Make sure to set a default value of "true" in this component because we don't want to disable confirm button in other places where we are using this modal. 3.In ConfirmContent page do the following imports
and change export default to
here App/src/components/ConfirmContent.js Line 57 in 33ed167
Don't forget to set the default value of enabledWhenOffline.
here App/src/components/ConfirmContent.js Line 66 in 33ed167
Here if we want to disable the cancel button we can pass this value to cancel button too. What alternative solutions did you explore? (Optional)Here instead of step 3,4,5 we can also use the same approach of disabling button that we are using in FormAlertWithSubmitButton App/src/components/FormAlertWithSubmitButton.js Lines 72 to 92 in 478e0b7
|
Updated the expected behavior to: "The "Yes, continue" button should be disabled on the confirmation modal when offline" |
Job added to Upwork: https://www.upwork.com/jobs/~01b9448cf41ba17959 |
Current assignee @MitchExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
Thank you guys for the proposals! I agree to add new props to @samh-nl @neonbhai @Nodebrute All of you have a similar proposal in general, and @Nodebrute did a great job detailing their solution. Since the solution is pretty straightforward, the first proposed solution already addressed the fix, we can go with @samh-nl proposal. 🎀 👀 🎀 C+ reviewed! |
Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @mollfpr 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @samh-nl 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
📣 @hungvu193 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
PR is ready for review: #23917 |
🎯 ⚡️ Woah @mollfpr / @samh-nl, great job pushing this forwards! ⚡️ The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.49-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-08-10. 🎊 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.
For reference, here are some details about the assignees on this issue: 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:
|
Reminder set to pay on 8/10. Lets tackle the BZ steps above in the meantime @mollfpr 👍 |
Summary for payment: Reporting: $250 @hungvu193 (Upwork) |
Correct! They were the contributing engineer on this one as opposed to the reviewer so I think it doesn't matter really 👍 |
Paying out now. Friendly bump on the BZ steps @mollfpr 🙇 |
All paid and contracts ended! Closing once BZ steps are done |
Thanks for taking the payment early @MitchExpensify and sorry for the delay 🙏
There's no offending PR. Before, we didn't have the ability to control either the submit button on the confirm modal can be disabled based on certain conditions. In the PR, we added new props to accommodate that, and for the close page, we disabled the submit button when the network was offline.
The page that uses the confirm modal may have a different case for handling the submit button on the network status. So, this issue is not very common to all the pages. So the regression test should be enough.
|
QA test update added! Thanks again @mollfpr |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The "Yes, continue" button should be disabled on the confirmation modal when offline
Actual Result:
Still able to request Close Account when offline because the confirm modal is not dismissed.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.44-0
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
Notes/Photos/Videos: Any additional supporting documentation
RPReplay_Final1690196584.MP4
Recording.3856.mp4
Expensify/Expensify Issue URL:
Issue reported by: @hungvu193
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690086679675019
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: