Repository navigation
Fix HAS read presets requests failing after an out of range request - #1015
Merged
Merged
Conversation
zxzxwu
approved these changes
Oct 22, 2026
kwy404
added a commit
to kwy404/kwy404
that referenced
this pull request
Oct 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.
Root cause:
HearingAccessService._on_read_presets_request(bumble/profiles/hap.py) setsread_presets_request_in_progress = Truebefore it validates the request. When the request is rejected withOUT_OF_RANGE(StartIndex 0, NumPresets 0, or no preset at or after StartIndex), the flag is never cleared, because only_read_preset_responseresets it and that coroutine is never spawned. From then on every Read Presets Request, and every Write Preset Name which checks the same flag, fails withPROCEDURE_ALREADY_IN_PROGRESS, for all clients and across reconnections:Fix: set the flag right before spawning
_read_preset_response, after all the checks pass. The busy check stays at the top, so a second request while a response is still being indicated is rejected as before.Test: added
test_read_presets_after_out_of_range_requesttotests/profiles/hap_test.py. It sends a request with StartIndex 0, then a valid one, and expects the first preset to be indicated. Before the fix the second write fails withPROCEDURE_ALREADY_IN_PROGRESS, after the fix it passes.pytest tests/profiles/hap_test.py,ruff checkandblack -S --checkpass.