Every booking surface posts a booker's clicks through one queue, which waits before sending so that a run of clicks becomes one request: four presses on a plus button, or six seats picked off a plan in a few seconds. The wait is one number for the whole site, since it is one booker, and it is currently written in the JavaScript itself as Drupal.yoyaku.delay = 400.
Four hundred milliseconds is a guess, and the right value depends on the venue: how fast its bookers click, how contended its seats are, and how far its visitors sit from the server. A site that wants a longer window has to edit the library to get one, which is a patch to carry.
So it becomes a setting of yoyaku_presentation, the module that owns the queue. A site setting rather than a field rule: this is not a behavior of a resource, it is how long the browser waits before it speaks, and a delay that differed per resource would teach a booker that one page of the site is slower than another. The JavaScript keeps its own default, so a site that never touches the setting behaves exactly as it does today, and the number is published to the browser only on a page that actually loads the queue.
Remaining tasks
- A setting on the presentation settings form, in milliseconds, with the current value as its default and a description saying what it buys.
- Config schema, and the setting published to
drupalSettingsonly where the queue library is attached. - The queue reads the setting and falls back to its own constant, which stays the documented default.
- A test that the queue waits as long as the site says, and the catch-up wait after an answer is not this number.
AI-Generated: Yes (analysis, issue text and code by Claude Opus, reviewed and run by the maintainer)
Issue fork yoyaku-3616594
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedComment #5
mably commented