Repository navigation
fix(ancs): a late response no longer consumes the request in flight - #345
Merged
Merged
Conversation
Data Source responses carry no request id; the sequencer credited whatever
completed to the request in flight. When a GetNotificationAttributes answer
turned up after its own request had timed out, it completed the next request
instead: the client then discarded it on the uid mismatch ("discarding a
response for uid N while N+1 was in flight"), and the next notification was
lost along with it.
Seen on a real iPhone while the daemon was paging an unreachable BR/EDR link
(each attempt ~30 s on the shared radio): answers arrived just past the 15 s
timeout and every second notification vanished.
A completed GetNotificationAttributes response whose echoed uid is not the one
in flight is now dropped, and the request in flight keeps waiting for its own
answer. The existing test that documented the old behaviour now checks this.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
zackb
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Data Source responses carry no request id, so
ControlPointSequencercredits whatever completes to the request in flight. When aGetNotificationAttributesanswer turns up after its own request has timed out, it completes the next request instead. The client then discards it on the uid mismatch (discarding a response for uid 86 while 87 was in flight), and notification 87 is lost along with it.Seen on a real iPhone while the daemon was paging an unreachable BR/EDR link (each attempt holds the shared radio ~30 s): answers arrived ~0.2 s past the 15 s timeout, and each one took the following notification down with it.
Change
A completed
GetNotificationAttributesresponse whose echoed uid is not the request in flight is dropped, and that request keeps waiting for its own answer (the assembler is re-armed for it). Only notification-attribute responses are checked; they are the only ones with a uid to compare.The existing test that documented the old behaviour (
ALateResponseIsDeliveredAgainstTheWrongRequest) now checks the new one (ALateResponseDoesNotConsumeTheRequestInFlight): the stale answer completes nothing, and the in-flight request then completes with its own.Testing
🤖 Generated with Claude Code