Skip to content

Serialize mobile BLE operations across sessions - #3

Merged
jeremie5 merged 1 commit into
mainfrom
agent/mobile-operation-leases
Jul 30, 2026
Merged

Serialize mobile BLE operations across sessions#3
jeremie5 merged 1 commit into
mainfrom
agent/mobile-operation-leases

Conversation

@jeremie5

Copy link
Copy Markdown
Owner

What changed

  • add a synchronous, exact {deviceId, sessionId, operation} lease coordinator for every foreground Ozealis BLE read/write and for connect/disconnect transitions
  • make settings, logs, control, calibration, OTA, driver, and delayed-confirmation paths reject stale work after every awaited boundary
  • revoke paged CSV transfers before and after each GATT page request/response so invalidation cannot dispatch a later page
  • serialize Ozealis and PLX scans across permission/native stop-start awaits, filter queued cross-service results, and make Bluetooth-loss/unmount recovery tombstone stale transition/session ownership
  • protect same-device replacements from stale connection cleanup and keep stale finally blocks from clearing replacement busy state
  • add executable lease/scan/CSV regressions, AST transport classification gates, CI/local verification steps, and matching protocol/security/release documentation

Why

The UI busy state is render-delayed and could not serve as an atomic lock. Double taps, delayed alerts, reconnects, Bluetooth loss, scan handoffs, paged transfers, and stale async cleanup could therefore overlap or publish against a replacement device session.

Impact

Sensitive mobile BLE work is now admitted synchronously and remains bound to one immutable operation/session identity. Stale work cannot send later writes, request another CSV page, overwrite replacement state, release replacement busy ownership, or revive a scan/connection after teardown. These are app-local lifetime controls; firmware interlocks remain the safety boundary.

Validation

  • node scripts/verify-local.mjs
  • mobile operation-lease, validation, retained-CSV, and PLX tests
  • TypeScript and Expo web-export smoke
  • default and bench-PWM PlatformIO builds plus flash-budget checks
  • protocol, release-text, documentation-link, Simple-copy, and repository-hygiene gates

The production audit matches the reviewed baseline: 11 moderate, 0 high, 0 critical.

@jeremie5
jeremie5 marked this pull request as ready for review July 30, 2026 13:37
@jeremie5
jeremie5 merged commit 3cacdac into main Jul 30, 2026
4 checks passed
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