probo icon indicating copy to clipboard operation
probo copied to clipboard

New measure dialog: double click submits twice and creates duplicate measures

Open hex4a4a53 opened this issue 2 months ago • 1 comments

Summary

The submit button in the New measure dialog (Governance > Measures) is not disabled while the createMeasure mutation is in flight. A double click fires the mutation twice and creates two identical measures.

Version

0.291.0, self-hosted via compose.prod.yaml.

Steps to reproduce

  1. Go to Governance > Measures and open the new measure dialog.
  2. Fill in Measure name, Description, Category.
  3. Double click Create measure (a fast double click, as a user would do if the UI feels unresponsive).

Actual

Two measures are created and two success toasts appear. Confirmed in the database — the two rows are 32 ms apart:

name                   | cnt | first                         | last
Double click race test |  2  | 2026-09-20 03:13:30.614341+00 | 2026-09-20 03:13:30.646838+00

Expected

The button is disabled (or the submit is otherwise guarded) once the mutation is in flight, so only one measure is created.

Why this is easy to hit

A user on a slow connection who perceives no immediate feedback will naturally click again, which silently produces a duplicate register entry.


Related minor UX observation (same dialog)

The Category field renders as:

<input required="" placeholder="Select category" name="category">

It is a free-text input — there is no dropdown, combobox, datalist or autocomplete — but the placeholder "Select category" reads like a picker, and the label carries no required marker. Leaving it empty and clicking Create measure only triggers the browser's native validation tooltip, with no GraphQL request sent.

That combination reads as "the Create button does nothing", which is what initially led us to believe measure creation was broken altogether. Either a real picker with existing categories, or a placeholder like "e.g. Access Control" plus a required marker, would remove the ambiguity.

Happy to open this part as a separate issue if you'd prefer to keep them apart.

hex4a4a53 avatar Sep 20 '26 03:09 hex4a4a53

Fixed by #2372! Thanks for your feedback. Closing the issue, feel free to reopen if the update does not fix your problem.

lukkor avatar Nov 23 '26 17:11 lukkor