A notice blinks on every press of a stepper, and a booker reads the blink as news: something changed, when nothing did.

Steps to reproduce. On a booking page, press plus until an answer says something about the offer, for instance a per-order allowance being reached. Press plus again. The sentence disappears and reappears, although the answer said exactly what the answer before it said.

Why. Drupal.yoyaku.say() takes a whole answer under one topic. It dropped every line the topic had put on screen and built them again from the new list. A run of clicks against a limit answers with the same sentence every time, so an identical line was destroyed and remade: the region was empty for a frame, .yoyaku-notice:empty collapsed it, and the sentence flickered back into place. The words were right; the redraw was the lie.

What it should do. Reconcile, sentence by sentence, against what is on screen. The same words in the same place are left exactly as they stand, down to the element; a changed line is rewritten where it is; a surplus line goes; a missing one is added. Only what actually differs reaches the DOM, so an answer that repeats itself is invisible.

How it is tested. On the ELEMENT rather than on the words, because the words were always right: the test marks the line the first answer produced and looks for its mark after an identical second answer. The mark survives only if the line was left where it stood, and the scenario was seen to fail against the rebuild.

Introduced by the claim endpoint in #3617848: Claim a party's places through an endpoint of its own, so the booking page stays cacheable and its notices stay long enough to be read, which is where a card gained the ability to carry more than one sentence at a time.

AI-Generated: Yes (Claude Code wrote the code and the test on the merge request, from a bug the maintainer met while testing. I reviewed and ran them before pushing.)

Issue fork yoyaku-3618086

Command icon 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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed f7dff754 on 1.x
    fix: #3618086 Leave a notice alone when the answer repeats itself, so a...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.