Skip to content

Pairing 4/6: share the add-device flow and keep the old band on failed replacement - #694

Draft
mikenrafter wants to merge 7 commits into
OpenStrap:mainfrom
mikenrafter:split/669-add-device
Draft

mikenrafter wants to merge 7 commits into
OpenStrap:mainfrom
mikenrafter:split/669-add-device

Conversation

@mikenrafter

@mikenrafter mikenrafter commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Section 4 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.

Use one flow for scanned devices and connect-time band discoveries, with an explicit choice before saving a band as a workout sensor. Route Oura and Mi Band authentication to their existing screens.

Replacement now verifies and saves the new band before retiring the old pairing. A cancelled picker or failed bootstrap/save keeps the old primary record; connection failures attempt to reconnect it. The app still uses one primary engine, so the radio connection can briefly interrupt. After success, retire only the exact old ASK band rather than removing every band. Copy describes the failure behavior.

Real-iPhone gate remains open: ASK after FlutterBluePlus scanning, overlapping approvals, exact old-band removal, retry/relaunch/background restore, and replacement during an offload. Releasing the restore central does not prove that no other central is alive. System-selected identity remains the iOS 18+ limit described in section 2.

unpairSession aborts the current session; it does not wait for all historical data and the final batch ACK. This change does not modify history storage or ACK ordering.

Individual section diff.

Validation: local localization generation and full flutter analyze --no-pub pass. Focused test files pass: ui2_pair_sheets_test, app_state_pairing_confirmation_test, device_picker_test, sensor_cap_test, pair_sensor_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.

Screenshots

Flutter widget renders using fixture data and the bundled Manrope font. Native iPhone testing remains outstanding.

Band choice before replacement

Pair replacement before retiring the current band

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant