Nothing pins the race where Drupal ignores a submit dispatched before it has finished the previous answer

Two tests against the shared queue, where the retry lives, plus one clause in the documentation.

The window is held open rather than waited for. Core chains a response's commands and waits on any that returns a promise, clearing its in-progress flag only once that chain resolves. So the state command is wrapped to resolve after a beat, which is exactly what a loaded machine does for free. The re-send is scheduled by one of those very commands, so it aims straight into the window where a dispatch is swallowed.

testTheClickIsPostedWhileDrupalIsStillAnswering makes a click while a request is out and asserts the quantity reaches storage. Removing the retry, it fails: storage holds one where two were clicked. testClickDuringTheRequestSurvives next to it passes either way on a fast runner, which is why the cause took so long to find.

testTheGestureFinishedAfterTheAnswerStillReachesTheServer covers the second question. A number is typed while a request is out and finished with after the answer has been applied, at a moment when Drupal is still busy. Collapsing the two guards - asking "may I dispatch" of the gesture as well - fails it: the gesture is held back until after the only thing that would have sent it has already run. That was a comment; it is an assertion now.

Both negative controls were run, not reasoned about: the first fails with the retry deleted, the second fails with the guards collapsed, and both were seen to do so before this was pushed.

Two things found while writing them, both my own mistakes rather than the code's. The first draft typed a quantity the fixture cannot give - the allocation is two - so the server corrected it and the test failed against working code. The second left the wrapper armed for every answer, so each answer re-provoked the gesture and the test drove itself in circles; it now holds the first answer only.

No new strings, so no translation change. The documentation gains one clause, in the place that already explains why the two questions are different, to say that they are now enforced rather than merely described.

Verified: OfferStepperTest 11/11.

Merge request reports

Loading
Loading