Skip to content

Harden Swift beacon syncing: guard major/minor + log skipped syncs#616

Merged
stevepopovich merged 4 commits into
masterfrom
stevepopovich/beacon-major-minor-guard
Jun 5, 2026
Merged

Harden Swift beacon syncing: guard major/minor + log skipped syncs#616
stevepopovich merged 4 commits into
masterfrom
stevepopovich/beacon-major-minor-guard

Conversation

@stevepopovich

@stevepopovich stevepopovich commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #607 addressing review feedback from @nickdonnelly on #615. Two small hardening fixes to the ported Swift beacon-sync methods in RadarLocationManager+Swift.swift.

Changes

  1. Guard against non-numeric beacon major/minor (#615 comment)

    • RadarBeacon.major/.minor are Strings. The previous Int(beacon.major) ?? 0 silently fell back to a 0/0 CLBeaconRegion when a value wasn't a parseable integer — monitoring the wrong region. Now a malformed major/minor skips the beacon and logs an error, mirroring the existing proximityUUID guard.
  2. Log skipped syncs (#615 comment)

    • The three useRadarModifiedBeacon early returns and the tracking/options guard in replaceSyncedBeaconUUIDs returned silently. Added debug logs so it's clear when/why beacon syncing is skipped, matching the existing log in replaceSyncedBeacons.

Notes

  • Behavior change is limited to the malformed-input path (previously synced a bogus 0/0 region; now skips it). Valid input is unchanged.

stevepopovich and others added 3 commits June 4, 2026 17:21
Int(beacon.major) ?? 0 silently fell back to a 0/0 region when a beacon's
major/minor were not parseable integers, which would monitor the wrong region.
Skip the beacon and log an error instead, mirroring the proximityUUID guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The useRadarModifiedBeacon early returns and the tracking/options guard in
replaceSyncedBeaconUUIDs returned silently, making it hard to tell why beacons
weren't synced. Add debug logs to match the existing log in replaceSyncedBeacons.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@stevepopovich stevepopovich marked this pull request as ready for review June 5, 2026 13:59

@nickdonnelly nickdonnelly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@stevepopovich stevepopovich merged commit b0072c5 into master Jun 5, 2026
2 checks passed
@stevepopovich stevepopovich deleted the stevepopovich/beacon-major-minor-guard branch June 5, 2026 15:12
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.

3 participants