Repository navigation
Pairing 2/6: bind scans to the selected band - #692
mikenrafter wants to merge 4 commits into
Conversation
Pre-merge checks:
|
Reviewer's GuideSchema and migrationsMake device upserts transactional so a failed update cannot leave a partially inserted device row.
Data structuresAdd registry role, physical-kind, and main-device metadata, then assign it to each supported device entry.
Define the band identity, evidence, pairing confirmation, paired-device, outcome, and pairing-I/O data structures used across discovery and pairing.
APIExpose a scan-choice predicate that rejects a different remote ID or a conflicting advertised generation while allowing unknown-generation advertisements.
Extend the transport scan interface to accept the chosen remote ID and generation, and apply that choice while accepting scan results.
Pass the selected device identity through AppState to the transport scan.
Allow PairingScreen to receive the selected entry and remote ID for non-AccessorySetupKit pairing.
Change notify-sensor pairing to return a typed outcome and accept scan evidence and an explicit device-bound confirmation.
Uses of the APIPass the selected remote ID and entry generation into non-AccessorySetupKit scans.
Supply the candidate's band evidence to notify-sensor pairing and translate its typed outcome for the picker.
Carry candidate band evidence through the profile sensor-pairing path and translate pairing outcomes for display.
ImplementationCentralize UUID normalization and band identity matching, preserve ranked per-device scan evidence, and implement the injected pairing decision and persistence flow.
Refactor sensor scanning to retain band evidence, preserve the first adapter claim across system-device queries, and construct candidates with both sensor and band identity.
Delegate connected-device pairing to the shared decision flow, recheck band evidence before saving, and adapt Bluetooth discovery, characteristic checks, bonding, and persistence to the pairing interface.
Add registry-level hinted-name matching for reuse by identity and scan logic.
UIAdd localized user-facing text for a band refusal, preserving uncertainty when only a WHOOP name identifies the device.
Update pairing-related localization resources for the new band-refusal message.
TestsCover band identity matching, evidence ranking, safe pairing outcomes, atomic persistence, device roles, and scan-choice binding.
Update existing candidate and hinted-name tests for the expanded candidate shape and shared matcher.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
fc76b93 to
8925b4a
Compare
8925b4a to
3a83fcc
Compare
Section 2 of the split requested in #669. Draft until preceding sections land. This upstream PR temporarily includes those dependencies; review this section through the link below.
Pass the selected remote ID and generation through PairingScreen, AppState and transport. A non-ASK scan skips a different device or a conflicting advertised generation.
On iOS 18+, AccessorySetupKit's system sheet chooses the band. This scan predicate does not constrain that sheet, and there is no selected-row check after connect. A name-only advertisement also cannot establish generation; discovery must identify it.
Individual section diff.
Validation: local localization generation and full
flutter analyze --no-pubpass. Focused test files pass: pairing_choice_test, gen5_pairing_filter_test and ui2_tokens_test. Physical iPhone testing remains outstanding.Upstream review order: 1 ready → 2 draft → 3 draft → 4 draft → 5 draft → 6 draft. All target upstream main; draft diffs include preceding dependencies. Use the individual section link above to review this section alone.