fix(asks): one submit saves every ask on the page
Operator report (via infra-ops): on a page with several asks, a submit
saved only the pressed one and the reload wiped the rest. Confirmed on
auk-audition: one POST at 15:02:23 saved the last ask on the page, then a
400 from the submit of an ask the reload had just blanked.
Client-side on both surfaces; /answer is unchanged. A submit on a pick
form, while another pick form on the page holds unsent input, sends every
changed ("dirty") pick form: one POST each, to its own action, with
Accept: application/json, in document order. A refusal stops nothing, and
untouched forms are never re-sent. With no other dirty form, a submit is
exactly what it was.
- embed.js (verbatim reports): reloads only when nothing was refused and
nothing of ours is dirty. Otherwise a server-rendered status line in the
submit block says what did not save, and input stays. A form the server
took gets a new baseline. A press during the flight is ignored.
- base.html (marks page, lightbox, review rail): one refresh in place. A
batch never reloads. Only forms the server took count as sent. In-flight
state and "just sent" are keyed by form identity (formKey) plus the fields
at the press, not the DOM node.
Two heid bug-hunt rounds: a four-arm panel on the first cut, then Hulda
alone on the fold. Ten findings reproduced red in a browser before their
fixes. Contracts: U3 "Submitting several asks at once" + INV-8, R2 C3
steps 2, 3 and 3a. Mutation tables u3_submit_all (15) and r2_submit_all
(11), all proved. Suite 928 -> 951.
This commit is contained in:
@@ -118,7 +118,7 @@ new = ''' except OSError:
|
||||
label = 'C3 client: no busy guard (a double-click writes twice)'
|
||||
file = "booth/templates/base.html"
|
||||
test = "tests/test_flow_browser.py::test_an_unsaved_choice_survives_a_save_elsewhere_and_a_double_click_writes_once"
|
||||
old = ''' if (form.__busy) return;
|
||||
old = ''' if (pending[flightKey(form)]) return;
|
||||
'''
|
||||
new = ''''''
|
||||
|
||||
@@ -133,8 +133,8 @@ new = ''''''
|
||||
label = 'C3 client: saves are not serialized'
|
||||
file = "booth/templates/base.html"
|
||||
test = "tests/test_flow_browser.py::test_quick_successive_flags_all_show"
|
||||
old = ''' queue = queue.then(function () { return run(form, data); })'''
|
||||
new = ''' queue = run(form, data)'''
|
||||
old = ''' queue = queue.then(function () { return run(form, data, snap); })'''
|
||||
new = ''' queue = run(form, data, snap)'''
|
||||
|
||||
[[mutation]]
|
||||
label = 'C3 the standalone marks page has no region'
|
||||
|
||||
Reference in New Issue
Block a user