Repository navigation
Stage 3: Driver phone gateway with durable BLE/GPS uploads - #3
Merged
Merged
Conversation
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.
The driver phone gateway collects GPS and forwards three-IMU threshold events through the existing authenticated Supabase RPCs, retaining data in a durable SQLite outbox during cellular outages. The deployment target is iPhone; existing Android code is retained without making Android hardware acceptance a requirement.
Implemented under
mobile/: explicit simulated BLE and configurable hardware BLE with reconnect backoff, phone GPS, owner authentication with SecureStore, stable identities/sequences and replay receipts, duplicate-safe FIFO retries, atomic offline session stop, and minimal parked setup/status screens. No driver dashboard, phone-generated acceleration, ESP32 firmware or privileged credentials.Verified live Supabase compatibility
The user applied the GPS accuracy migration. Validation against
zffpqwqabysvqjbnchgy.supabase.coconfirms 4.25 m accuracy roundtrip, legacy packets with null accuracy, negative/infinite accuracy rejection, timestamp preservation and first-write-wins replay behavior. No additional schema changes were made.The actual
SimulatedBlesource emitted one event from each IMU into the file-backed SQLite outbox and existing real RPCs. Sparse magnitude/location stayed null. Restart plus a deliberately lost response after a real server commit recovered without duplicates. Owner/observer read access and rejection of observer ingestion/anonymous access passed. Tests leave clearly labeled, finished simulated sessions; live-test GPS values are synthetic fixtures, not phone measurements.Software verification
Passed locally: 81 repository unit/integration tests, 21 mobile unit/integration tests, one additional live-backend integration test, 23 dashboard browser regressions, two live owner/observer dashboard browser checks, root/mobile TypeScript, formatting, dashboard production build, offline SDK dependency checks, and Android/iOS JavaScript/Hermes bundle exports. Live checks are explicitly opt-in and excluded from normal CI. Clock-driven browser tests now freeze time between explicit advances, preserving assertions while removing a timing race.
The existing dashboard production build works with real project history, route and all three IMU events; current IMU states stay unknown/gray and simulated provenance is visible. Live HTTP requests use a TLS-verified Node relay for this executor's proxy CA; live WebSocket delivery/direct browser TLS are not certified. The existing hosted URL returned an HTTP 401 access gate here, so hosted deployment access was not validated or changed.
Final commit CI: passed — both mobile and dashboard verification jobs succeeded on
1f63be25cfdd50bc61aaaa024c2e65cee2d850ae(run). Ready to merge from a software-validation perspective. Native iPhone deployment/background acceptance remains pending. The PR stays open and must not merge automatically.Free validation and iPhone limits
All software validation ran on Linux with Node 24. No Apple Developer Program membership, paid build service, device lab or newer Mac is required. Optional future free Personal Team signing still requires access to compatible Xcode/Mac/iPhone tooling and is untested for this project; no purchase or paid-distribution workflow is required by this PR.
iOS bundle export is not proof of physical iPhone compatibility. Native compilation/signing/installation, permissions, real CoreBluetooth/CoreLocation/Keychain/SQLite behavior, 1 Hz GPS cadence, cellular handoffs, locked-screen/background collection, Low Power Mode and force-quit/reboot recovery remain untested on an actual iPhone. Native restored-device subscriptions and uninterrupted killed-process BLE ingestion, firmware clock sync/replay/ACK and threshold application remain gaps. This is software validation, not approval for unattended driving.
See the validation report and free validation / exact iPhone limitations.