Skip to content

fix: warn users when GPS location is unavailable for SOS#31

Open
aditi123-hub wants to merge 1 commit into
umang24-cyber:mainfrom
aditi123-hub:fix-sos-gps-warning
Open

fix: warn users when GPS location is unavailable for SOS#31
aditi123-hub wants to merge 1 commit into
umang24-cyber:mainfrom
aditi123-hub:fix-sos-gps-warning

Conversation

@aditi123-hub

@aditi123-hub aditi123-hub commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the SOS workflow when GPS access is unavailable.

Previously, the SOS feature silently fell back to hardcoded Chandigarh coordinates when the user's location could not be determined. Users would see "HELP EN ROUTE" without any indication that their actual location was not being used.

This change adds clear user warnings and confirmation before fallback coordinates are used.

Related Issue

Closes #6

Changes Made

  • Added a visible warning banner when precise GPS location cannot be detected.
  • Added a confirmation dialog before dispatching SOS using fallback coordinates.
  • Prevented silent use of hardcoded fallback coordinates without informing the user.
  • Improved user awareness during emergency dispatch scenarios.

Testing

  • Tested manually
  • Added new unit/integration tests
  • Verified functionality in browser

Test Steps

  1. Block browser location permissions.
  2. Open Citizen Emergency Portal.
  3. Navigate to SOS section.
  4. Verify warning banner is displayed.
  5. Click "ACTIVATE SOS".
  6. Verify confirmation dialog appears.
  7. Verify SOS is sent only after explicit user confirmation.

Screenshots

GPS unavailable warning banner

image

Confirmation dialog before SOS dispatch

image

Checklist

  • Code follows project style guidelines
  • Changes are limited to the reported issue
  • Tested manually
  • No unrelated files included in commit

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.

SOS button sends hardcoded Chandigarh coordinates when GPS is unavailable and no user warning

1 participant