fix: KBeacon provisioner stuck — add status updates + fix disconnect handler #36

Closed
schwifty wants to merge 0 commits from schwifty/kbeacon-status-updates into main
Collaborator

Problem

KBeacon provisioner had zero status updates to the UI. During the connect/auth cycle (5 passwords × 5s timeout × 3 retries = up to 75s), the app shows a static "Connecting..." and looks completely stuck.

Also, the disconnect handler in ScanView only covered .connecting and .connected states — if the beacon dropped during .writing or .verifying, the UI would freeze permanently.

Fix

  • Added onStatusUpdate callback to KBeaconProvisioner (matching DXSmartProvisioner pattern)
  • Reports each phase: connecting, discovering services, authenticating (with password attempt count), writing params, saving to flash
  • Wired up status callback in ScanView for KBeacon type
  • Extended disconnect handler to also cover .writing and .verifying states

Test plan

  • Provision a KBeacon — verify status messages update in real-time
  • Disconnect beacon mid-write — verify app shows failure instead of hanging
  • DXSmart provisioning still works (regression check)
## Problem KBeacon provisioner had **zero status updates** to the UI. During the connect/auth cycle (5 passwords × 5s timeout × 3 retries = up to 75s), the app shows a static "Connecting..." and looks completely stuck. Also, the disconnect handler in ScanView only covered `.connecting` and `.connected` states — if the beacon dropped during `.writing` or `.verifying`, the UI would freeze permanently. ## Fix - Added `onStatusUpdate` callback to `KBeaconProvisioner` (matching DXSmartProvisioner pattern) - Reports each phase: connecting, discovering services, authenticating (with password attempt count), writing params, saving to flash - Wired up status callback in ScanView for KBeacon type - Extended disconnect handler to also cover `.writing` and `.verifying` states ## Test plan - [ ] Provision a KBeacon — verify status messages update in real-time - [ ] Disconnect beacon mid-write — verify app shows failure instead of hanging - [ ] DXSmart provisioning still works (regression check)
schwifty added 1 commit 2026-03-23 00:40:57 +00:00
KBeaconProvisioner had no onStatusUpdate callback, so the UI showed a static
"Connecting..." message during the entire auth cycle (5 passwords × 5s timeout
× 3 retries = 75s of dead silence). Now reports each phase: connecting,
discovering services, authenticating (with password attempt count), writing,
saving.

Also fixed ScanView disconnect handler to cover .writing and .verifying states —
previously only handled .connecting/.connected, so a mid-write disconnect left
the UI permanently stuck.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
schwifty closed this pull request 2026-03-23 02:23:59 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: payfrit/payfrit-beacon-ios#36
No description provided.