Skip to content

fix: preserve custom geofence names when toggling predefined areas#113

Merged
hokiepokedad2 merged 2 commits intomainfrom
fix/109-geofence-area-toggle
Apr 4, 2026
Merged

fix: preserve custom geofence names when toggling predefined areas#113
hokiepokedad2 merged 2 commits intomainfrom
fix/109-geofence-area-toggle

Conversation

@hokiepokedad2
Copy link
Copy Markdown
Contributor

Summary

  • Root cause: syncSelectedFromAreas() in the Areas page was overwriting selectedAreas with only predefined area names on every checkbox toggle, silently dropping custom geofence kojiName entries
  • Fix: Preserve custom geofence names (names not in the predefined areas list) across checkbox toggles, matching the preservation logic already used in saveAreas()
  • Scope: Single method change in area-list.component.ts — the same pattern saveAreas() already uses at lines 264-270

Bug scenario (before fix)

  1. User has custom geofence "my_park" active alongside predefined area "downtown"
  2. User navigates to Areas page, toggles any predefined area checkbox
  3. syncSelectedFromAreas() fires, overwrites selectedAreas to only predefined names — "my_park" is lost
  4. User saves — backend receives only predefined areas, custom geofence is deactivated
  5. User must navigate back to Geofences page to re-activate

After fix

Custom geofence names are preserved through checkbox toggles and included in the save payload.

Closes #109

Test plan

  • Create a custom geofence and activate it for the current profile
  • Navigate to the Areas page — verify custom geofence appears in the selected chips
  • Toggle predefined area checkboxes on/off — verify custom geofence chip remains
  • Save areas — verify custom geofence is still active on the Geofences page
  • Clear all areas — verify custom geofence names are preserved (managed via Geofences page)
  • Cancel changes — verify state reverts correctly including custom geofence names

syncSelectedFromAreas() was overwriting selectedAreas with only
predefined area names, silently dropping custom geofence kojiNames.
When the user then saved, those geofences were removed from their
area list, requiring navigation back to the geofences page to
re-activate them.

Now preserves custom geofence names (not in the predefined areas
list) across checkbox toggles, matching the preservation logic
already used in saveAreas().

Closes #109
@hokiepokedad2 hokiepokedad2 merged commit ff67dca into main Apr 4, 2026
4 checks passed
@hokiepokedad2 hokiepokedad2 deleted the fix/109-geofence-area-toggle branch April 4, 2026 06:34
github-actions bot added a commit that referenced this pull request Apr 4, 2026
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.

feat: show only the most specific area name in DM notifications

1 participant