Repository navigation
Conversation
The setter/getter callback contract grows ad hoc: camera setters get context through a magic-parameter hack (sender_client_addr), callbacks cannot answer a HAP status (issue #75), getters are sync-only and a raising getter fails the whole /accessories response, async-ness is inconsistent across the callback levels, and per-client state is keyed by the (ip, port) tuple which is only unique while a connection lives. refactor.md records the agreed redesign: delegate objects with frozen contexts and an opaque connection handle, async-by-design dispatch validated at registration, a curated HapStatusError protocol, a grouped-first gate write pipeline with veto, a uniform async read path, a legacy facade that keeps today's callbacks working unchanged, the parked driver-level listener alternative, and the phased implementation plan.
This was referenced Nov 13, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #559 +/- ##
==========================================
- Coverage 92.00% 91.97% -0.03%
==========================================
Files 50 50
Lines 10839 10839
Branches 1404 1404
==========================================
- Hits 9972 9969 -3
- Misses 579 582 +3
Partials 288 288 🚀 New features to boost your workflow:
|
Owner
Author
|
Folded into #562: the design overview now lives in the API PR's description, and the final design will land in the Sphinx docs as the phases merge. No repo file needed - refactor.md is not committed anywhere. |
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.
First PR of the callback interface refactor stack (see
refactor.md, added here).What
refactor.mdrecords the agreed redesign of the setter/getter callback interface:CharacteristicDelegate/ServiceDelegate) with frozen contexts (client_addr,client_uuid,connectionhandle,deadline,is_admin) — new input data arrives as new context fields, never as signature changes.HapStatusErrorprotocol so callbacks can answer a HAP status instead of the generic-70402(closes Allow characteristics to indicate set value failure #75 for new and existing code).(ip, port)tuple to a stable connection handle.The document also details exactly what changes in behavior compared to today (split into guaranteed invariants, new behavior, and three deliberate changes affecting legacy users), the migration notes for embedders (Home Assistant), the parked driver-level listener registry alternative, and the five implementation phases.
Why a document PR
Reviewing the contract before the code: the stack's later PRs implement it phase by phase, each against the invariants recorded here.
The crash investigation note for the media worker segfaults is tracked separately in #558.