Page MenuHomePhabricator

Dialog submit buttons don't disable on click
Closed, ResolvedPublic

Description

I have seen this bug manifest in two different ways:

  1. Duplicate tickets are created.
  2. Duplicate transactions are created.

See the transactions on T11143 and T11144 for an example. In order to reproduce this issue, you should be able to follow these steps:

  1. Create a new Maniphest task and fill out all relevant details (they aren't important here).
  2. Click on the "Create New Task" button several times in quick succession. More clicks gives you more XP.

The same steps apply to the "Merge Duplicate Tasks" workflow as well.

Event Timeline

I can't reproduce locally or on Phacility in Chrome/Mac. Is there a specific browser/os I should test?

I am using Chrome on Ubuntu, but I don't think k the browser/OS has much to do with it. I'm guessing that you can't reproduce it because you have more internets than I do. If you can artificially throttle the connection speed then it might be easier to reproduce.

Wouldn't form re-submission be disabled through javascript on the client?

Does the submit button not go "disabled" when you click on it? JS should be immediately doing this. I can't not get it to do this on anything I test.

Ah I see. So for the "create ticket" workflow, it only seems to happen when creating a ticket from a workboard. In this case, I do not see the button go disabled.

Nice! I was able to duplicate that. Might be all? dialogs.

chad renamed this task from Race conditions with form submissions to Dialog submit buttons don't disable on click.Jun 14 2016, 8:11 PM
chad edited projects, added PHUI; removed Maniphest, Transactions.
chad added a subscriber: epriestley.
eadler added a project: Restricted Project.Jun 16 2016, 6:26 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jun 16 2016, 6:28 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jul 4 2016, 9:02 PM

https://secure.phabricator.com/diffusion/P/browse/master/webroot/rsrc/js/core/behavior-form.js:57
looks like it's supposed to be listening to submit, but there's no submit event being fired while in a dialog; It does fire when the same dialog is loaded as a full-page, so some magic is happening there.

There's also a lot of if (workflow) return; in that file, which makes me think dialogs are supposed to handle their own submit?