[Webkit-unassigned] [Bug 242314] New: Double clicking submit button causes forms to be submitted twice.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jul 4 06:28:56 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=242314
Bug ID: 242314
Summary: Double clicking submit button causes forms to be
submitted twice.
Product: WebKit
Version: Safari 15
Hardware: Mac (Apple Silicon)
OS: macOS 12
Status: NEW
Severity: Normal
Priority: P2
Component: Forms
Assignee: webkit-unassigned at lists.webkit.org
Reporter: fraser at google.com
CC: cdumez at apple.com, wenson_hsieh at apple.com
Fill out a form (ether GET or POST), press submit, and the results are sent to the server. But if you double-click the submit button (as many people do), two separate requests are sent. This simple bug is the source of a vast number of hard to reproduce glitches:
* doubled posts being submitted to forums.
* server-side race conditions which have caused data loss (even code written for a single user needs to be thread-safe).
* one-time actions that quietly succeed (first click) but a failure message is displayed to user (second click).
* add one thingmy to your shopping cart, get two. Remove one, lose both. (Great if you want pairs of everything.)
* order your two thingmys, and four arrive in the mail (along with two invoices).
Because of this bug, every form that performs an action needs to be wrapped in a JavaScript double-click trap, or else caught server-side (which involves logging requests and checking the log for a similar request in the past second).
Reproducible: Always
Steps to Reproduce:
Point Safari or Chrome at a form. In a terminal window, "tail --follow access.log". Double click (or triple click) the submit button.
Actual Results:
Webkit browsers will submit the form as many times as the mouse was clicked.
Expected Results:
Webkit browsers should not submit a form a second time within the double-click time frame. Webkit browsers perform properly on links; double-clicking a link does not generate two requests.
Interestingly, I filed this exact bug against Mozilla 19 years ago (#238159). At the time, Mozilla was the only browser exhibiting this bug, IE 5, Opera 7, and Netscape 4 were not affected. Now that Mozilla has finally been fixed, Webkit has started doing the same thing.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220704/377dbbaf/attachment.htm>
More information about the webkit-unassigned
mailing list