Skip to content

Fix GPS tracking for walk-test signal mapping#267

Merged
tvancott42 merged 5 commits intomainfrom
bugfix/gps-polling
Feb 14, 2026
Merged

Fix GPS tracking for walk-test signal mapping#267
tvancott42 merged 5 commits intomainfrom
bugfix/gps-polling

Conversation

@tvancott42
Copy link
Collaborator

@tvancott42 tvancott42 commented Feb 14, 2026

Summary

  • GPS coordinates were never captured during signal polling due to a race condition - OnAfterRenderAsync checked _client before it was loaded by OnInitializedAsync
  • Switched from one-shot getCurrentPosition to watchPosition for continuous GPS tracking, which keeps the GPS hardware active during walk tests and is more efficient than repeated one-shot requests
  • Added a "Location Permission Denied" banner so users know to re-enable location access if they accidentally denied it
  • Zombie write protection: when the GPS watcher goes silent (browser died but Blazor circuit still alive), stops persisting all data after 15 seconds. GPS signal loss still fires error callbacks, so silence reliably indicates a dead browser.
  • First poll now fires immediately instead of waiting 5 seconds, so the "Connecting..." state is near-instant
  • Added "Connecting..." indicator before first poll data arrives
  • Minor CSS polish for the live status indicator

Test plan

  • Verified GPS coordinates saved on every signal ping (2-5m accuracy)
  • Verified wired devices don't trigger location permission prompt
  • Verified GPS watcher cleans up on page navigation
  • Verified permission denied banner appears when GPS is blocked
  • Verified zombie writes stop ~15 seconds after killing the browser
  • Verified new session picks up GPS correctly after restart
  • Verified first poll fires immediately on page load
  • Build passes with 0 warnings

@tvancott42 tvancott42 force-pushed the bugfix/gps-polling branch 3 times, most recently from b5e3ae2 to d951b26 Compare February 14, 2026 17:44
- GPS was never captured due to race condition: OnAfterRenderAsync
  checked _client before it was loaded, so the condition always failed
- Switched from one-shot getCurrentPosition to watchPosition for
  continuous GPS tracking during walk tests
- GPS watcher starts on first poll (after client identity is known),
  skips wired devices
- Added "Location Permission Denied" banner when browser blocks GPS
- Uses DotNetObjectReference for JS-to-.NET callbacks
- Properly cleans up watcher via IAsyncDisposable
@tvancott42 tvancott42 merged commit f7a45a8 into main Feb 14, 2026
1 check passed
@tvancott42 tvancott42 deleted the bugfix/gps-polling branch February 14, 2026 18:20
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