Skip to content

fix(android): a request whose USB entry ended never reacquires through its retained handle - #1044

Merged
egerev merged 1 commit into
mainfrom
bb/usb-ended-request-never-reacquires-thr_ngb3g9karf
Nov 18, 2026
Merged

egerev merged 1 commit into
mainfrom
bb/usb-ended-request-never-reacquires-thr_ngb3g9karf

Conversation

@egerev

@egerev egerev commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

UsbLifecycle.refresh recorded only entries that ended before claiming the serial (#1036). A request whose connector ended after USB loss could acquire again through its retained handle once a different request's entry became the previous one and ended. The #1032 contract says "retaining that request never reacquires its ended connector", and the code says one acquisition per generation.

Change (refresh only, +7/−8). Every ended entry's (owner, request) goes into the existing ended set. The settled path refuses those candidates, as the untouched path already did. This also covers the earlier same-task handle check. No new state store, retry, reset, grant, config or identity substitution. Receipt, cleanup, lease, epoch and admission checks are unchanged.

Accepted consequence (root). An ended request's handle cannot resume phone collection just because its old order is still active. A genuinely different, ordinarily admitted request still acquires once and supersedes.

New regression test_usb_ended_request_never_reacquires.py. Request A ends on USB loss. B reconnects, supersedes A's row, then ends on a second USB loss. Both handles stay retained with active orders, because no notification is replayed. Over 25 counted real supervision ticks (no sleep), neither acquires. A different request C then acquires exactly once and supersedes.

Validation.

Spec: ANYM-997
Change path: AUTO (lifecycle admission bookkeeping; no permissions, configuration, migration or live action)
Review record: none (owner 11-11: no reviews)

🤖 Generated with Claude Code

…h its retained handle

UsbLifecycle.refresh recorded only entries that ended before claiming the
serial. A request whose connector ended after USB loss could acquire again
through its retained handle as soon as a different request's entry was the
previous one and ended, contrary to the one-acquisition-per-request contract
(#1032: retaining that request never reacquires its ended connector).

Record every ended entry's (owner, request) in the existing ended set and
refuse those candidates on the settled path as on the untouched path. A
genuinely different, ordinarily admitted request still acquires once and
supersedes the held collection. Receipts, cleanup, lease, epoch and admission
checks are unchanged; nothing is retried or reset.

Spec: ANYM-997

Signed-off-by: egerev <egor@gosync.ai>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@egerev egerev added the ship Small-fix rule: orchestrator Diff read at head; merge-keeper may enqueue label Nov 18, 2026
@egerev
egerev added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit c06f8b5 Nov 18, 2026
31 checks passed
@egerev
egerev deleted the bb/usb-ended-request-never-reacquires-thr_ngb3g9karf branch November 18, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ship Small-fix rule: orchestrator Diff read at head; merge-keeper may enqueue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant