Context
A delayed overdrag scroll can resume after cancellation inside a newer drag on the same container SortZone. Reproduced with real container lifecycle tests and native pointer gestures on examples/grid/lockedColumns.
The Problem
Native sequence on Engine 51f3d4aa259ec4592ecca969cc6535e079e713d3 (tree-equivalent to the diagnostic candidate): overdrag a header; let the genuine DOM scroll finish but hold its owner promise; press Escape and release; start another header drag; release the old promise without sending another pointer move.
The first native scrollbar moves 0→190 px. Cancellation resets the old snapshot/index/proxy. The second drag starts at index3 with a fresh snapshot; releasing old work changes it to index4, rewrites its index map and wrapper positions, while the dragged component is still the second header. The native invariant fails:
old work cannot change the new gesture index
Expected: 3
Received: 4
The owner-model item order stays unchanged in this witness; the defect is corruption of the active gesture's presentation/mapping, not proof of an already-committed wrong drop. Unit controls reproduce both start-edge and end-edge continuations using startDrag → onDragMove → onDragCancel → startDrag, without assigning protected snapshot/index state.
The Architectural Reality
src/draggable/container/SortZone.mjs#onDragMove captures itemRects and the current index, then awaits scrollToIndex in both overdrag directions. Its post-await null checks detect an ended drag only while no newer snapshot exists. A new start makes that check pass again. The polling tail also awaits 30 ms before replaying the old pointer data, checking only the new gesture's isOverDragging.
The start/end queue in container/DragZone serializes lifecycle transitions, not outstanding move continuations. The captured rectangle-array identity already distinguishes snapshots, including a remote dashboard entry. No new token or public config is needed.
Design authority: existing cancellation contract restores the captured layout and commits no reorder (onDragCancel / processDragEnd); the failing native and unit invariants above show retired work mutating the subsequent operation.
Prescription checked: src/draggable/container/SortZone.mjs owns the concern. The continuation consumes that owner's captured geometry/index and must retire when its snapshot changes; a toolbar-specific patch or consumer delay would leave the shared defect. Independent zone-side source review agrees; the polling await is included in the same repair.
The Fix
Use the already-captured snapshot identity to retire an obsolete continuation after each owner-scroll await and before the polling tail replays pointer data. Preserve same-snapshot swapping and repeated edge scrolling. Extend the existing container SortZone unit coverage and retain a native public-example regression.
| Surface |
Authority |
Behavior |
Fallback |
Documentation |
Evidence |
| SortZone move continuation |
captured itemRects in onDragMove |
only its still-current snapshot may swap or replay |
obsolete continuation returns |
owning method JSDoc/comments |
both directions, polling, same-gesture controls |
| Public drag lifecycle |
startDrag, onDragCancel, end reset |
a new gesture remains untouched by old awaited work |
existing cancel cleanup |
existing lifecycle contract |
real native overdrag/cancel/restart |
Decision Record impact: none; preserves existing gesture ownership, no new API.
Acceptance Criteria
Out of Scope
Reworking scroll echo synchronization, drag admission, coordinate spaces, pin/refill policies, rejection handling in scrollToIndex, or adding generic drag generations/queues.
Avoided Traps
An end-only null check accepts the next gesture. Serializing every pointer move adds a queue to avoid recognizing stale work. A subclass workaround copies a base lifecycle obligation. Blanket cancellation that suppresses current polling would hide the defect by disabling autoscroll.
Related and ownership
#12906 (scroll term and original end-only checks), #12932 (scroll echoes), #14980 (gesture cancellation), #20517 (cancel body resync), #20641 (start/end queue), #20605 (pinning hooks). Their completed scopes remain intact.
Self-owned by @neo-gpt-sophie for the active drag reliability work; not a newcomer handoff. Engine-only defect and public reproducer. AI structure-map: N/A, Body runtime method repair; unit tests use the existing owner spec and native tests use the grid e2e family.
Live latest-open + closed sweep: latest20 open and closed SortZone search read on 13 November around02:28Z;31 open (orange), no equivalent owner found. Read relevant closed Out of Scope/Avoided Traps, own-assignment list (one unrelated open issue), and latest30 all-status A2A claims. Three Memory Core problem-framed queries found adjacent scroll/gesture history but no prior mapping of this exact stale continuation; KB returned the related closed tickets above.
Origin Session ID: 9bf9ac41-3a89-436f-9bdb-2e38327937eb
Retrieval Hint: "SortZone delayed overdrag scroll cancellation new drag old polling continuation snapshot"
Context
A delayed overdrag scroll can resume after cancellation inside a newer drag on the same container SortZone. Reproduced with real container lifecycle tests and native pointer gestures on
examples/grid/lockedColumns.The Problem
Native sequence on Engine
51f3d4aa259ec4592ecca969cc6535e079e713d3(tree-equivalent to the diagnostic candidate): overdrag a header; let the genuine DOM scroll finish but hold its owner promise; press Escape and release; start another header drag; release the old promise without sending another pointer move.The first native scrollbar moves 0→190 px. Cancellation resets the old snapshot/index/proxy. The second drag starts at index3 with a fresh snapshot; releasing old work changes it to index4, rewrites its index map and wrapper positions, while the dragged component is still the second header. The native invariant fails:
The owner-model item order stays unchanged in this witness; the defect is corruption of the active gesture's presentation/mapping, not proof of an already-committed wrong drop. Unit controls reproduce both start-edge and end-edge continuations using
startDrag → onDragMove → onDragCancel → startDrag, without assigning protected snapshot/index state.The Architectural Reality
src/draggable/container/SortZone.mjs#onDragMovecapturesitemRectsand the current index, then awaitsscrollToIndexin both overdrag directions. Its post-await null checks detect an ended drag only while no newer snapshot exists. A new start makes that check pass again. The polling tail also awaits 30 ms before replaying the old pointer data, checking only the new gesture'sisOverDragging.The start/end queue in
container/DragZoneserializes lifecycle transitions, not outstanding move continuations. The captured rectangle-array identity already distinguishes snapshots, including a remote dashboard entry. No new token or public config is needed.Design authority: existing cancellation contract restores the captured layout and commits no reorder (
onDragCancel/processDragEnd); the failing native and unit invariants above show retired work mutating the subsequent operation.Prescription checked:
src/draggable/container/SortZone.mjsowns the concern. The continuation consumes that owner's captured geometry/index and must retire when its snapshot changes; a toolbar-specific patch or consumer delay would leave the shared defect. Independent zone-side source review agrees; the polling await is included in the same repair.The Fix
Use the already-captured snapshot identity to retire an obsolete continuation after each owner-scroll await and before the polling tail replays pointer data. Preserve same-snapshot swapping and repeated edge scrolling. Extend the existing container SortZone unit coverage and retain a native public-example regression.
itemRectsinonDragMovestartDrag,onDragCancel, end resetDecision Record impact: none; preserves existing gesture ownership, no new API.
Acceptance Criteria
Out of Scope
Reworking scroll echo synchronization, drag admission, coordinate spaces, pin/refill policies, rejection handling in
scrollToIndex, or adding generic drag generations/queues.Avoided Traps
An end-only null check accepts the next gesture. Serializing every pointer move adds a queue to avoid recognizing stale work. A subclass workaround copies a base lifecycle obligation. Blanket cancellation that suppresses current polling would hide the defect by disabling autoscroll.
Related and ownership
#12906 (scroll term and original end-only checks), #12932 (scroll echoes), #14980 (gesture cancellation), #20517 (cancel body resync), #20641 (start/end queue), #20605 (pinning hooks). Their completed scopes remain intact.
Self-owned by @neo-gpt-sophie for the active drag reliability work; not a newcomer handoff. Engine-only defect and public reproducer. AI structure-map: N/A, Body runtime method repair; unit tests use the existing owner spec and native tests use the grid e2e family.
Live latest-open + closed sweep: latest20 open and closed SortZone search read on 13 November around02:28Z;31 open (orange), no equivalent owner found. Read relevant closed Out of Scope/Avoided Traps, own-assignment list (one unrelated open issue), and latest30 all-status A2A claims. Three Memory Core problem-framed queries found adjacent scroll/gesture history but no prior mapping of this exact stale continuation; KB returned the related closed tickets above.
Origin Session ID: 9bf9ac41-3a89-436f-9bdb-2e38327937eb
Retrieval Hint: "SortZone delayed overdrag scroll cancellation new drag old polling continuation snapshot"