Skip to content
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

Disable doubleclick and dialog close on distribution, request confirmations. (Urgent) #4644

Closed
2 tasks
cielf opened this issue Sep 8, 2024 · 3 comments · Fixed by #4667
Closed
2 tasks

Comments

@cielf
Copy link
Collaborator

cielf commented Sep 8, 2024

Summary

Disable double click and dialog close on distribution and request confirmations

Why?

This can cause bad things to happen, disrupting the event sourcing and ultimately causing a bank to be unable to process any transactions

Details

The confirmations in question are:

1/ Request confirmation

Navigation: sign in as verified@example.com. Chose Quantity. Fill in the form including at least one item/quantity pair, and click save. A confirmation will appear -- this is the confirmation screen we are talking about.

Both buttons should be disabled once the "yes, it's correct" button is clicked.
Please also change the colour of the "yes, it's correct" button to green (like the save button on the request)

2/ Distribution confirmation

Navigation: sign in as org_admin1@example.com. Choose Distributions , then click "+New Distribution". Choose a Partner and a "From storage location", then select an item and fill in a quantity. Click Save. A confirmation will appear -- this is the confirmation screen we are talking about.

Both buttons should be disabled once the "yes, it's correct" button is clicked.

Both buttons should be disabled once the "yes, it's correct" button is clicked.
Please also change the colour of the "yes, it's correct" button to green (like the save button on the distribution)

Criteria for completion

  • behaviour as described above
  • autoated tests confirming the behaviour
@jimmyli97
Copy link
Contributor

I'm happy to work on this today and tomorrow, I will open a draft PR with whatever changes I'm able to do by then

@jimmyli97
Copy link
Contributor

Despite running cpulimit, dev tool cpu throttling and network throttling I was unable to recreate a double submission where two events were created due to doubleclick or when clicking Yes followed by No.

I can disable the buttons and write tests to check if buttons are disabled, but I'm not sure what bad things can happen or what to test to avoid those bad things happening

@cielf
Copy link
Collaborator Author

cielf commented Sep 26, 2024

Please do disable the buttons appropriately. IIRC the bad thing that can happen is a creation of two records where one was meant .
Background: We had some of this issue quite some time ago, and took the hygiene step of disabling the various save buttons once clicked. That cleared it up, but we've seen it again since we introduced the confirmation step. So disabling the buttons once clicked is an important hygiene step.

cielf added a commit that referenced this issue Sep 30, 2024
#4644 disable buttons after clicking confirm on distribution/request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants