Skip to content

Fix untouched geofence saves on mobile - #57

Merged
justcallmekoko merged 1 commit into
developfrom
fix/mobile-empty-geofence
Aug 3, 2026
Merged

Fix untouched geofence saves on mobile#57
justcallmekoko merged 1 commit into
developfrom
fix/mobile-empty-geofence

Conversation

@justcallmekoko

@justcallmekoko justcallmekoko commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • render fully unconfigured geofence slots with empty label/latitude/longitude/radius values across browsers
  • validate radius only when any field in a slot is supplied
  • reject missing, non-numeric, or out-of-range configured radii before mutating any settings
  • preserve the existing 0.10-1.00 mile rule and configured geofence round-tripping

Diagnosis

The page serialized each default radius as 0.00 while also setting HTML min=0.10. Mobile browsers retain that numeric value and fail native constraint validation before POST, even when the slot is untouched. The POST handler also treated every emitted latitude field as a configured slot and silently clamped radius. The fix normalizes a fully untouched slot to empty form values and gates server validation on whether any field is provided.

Validation

  • python -m unittest discover -s tools -p test_*.py (10 passed)
  • git diff --check
  • ESP32-C5 compile and artifact steps passed in Actions run 30829916777

The repository has no web-portal test harness, so device/browser verification should use this regression matrix:

  1. Mobile browser, all five geofences untouched: submit succeeds and other settings remain saveable.
  2. Desktop browser, all five geofences untouched: submit continues to succeed.
  3. Existing configured geofence: values render and round-trip unchanged.
  4. Cleared configured geofence: all four blank fields save the canonical unconfigured record.
  5. Partial slot (label, latitude, or longitude supplied) with blank radius: client/server reject it.
  6. Configured radius below 0.10, above 1.00, or non-numeric via direct POST: server returns HTTP 400 before saving any settings.
  7. Configured radius at 0.10 and 1.00: submit succeeds.

@justcallmekoko
justcallmekoko merged commit 5888fc6 into develop Aug 3, 2026
2 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