Harden Swift beacon syncing: guard major/minor + log skipped syncs#616
Merged
Conversation
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>
ShiCheng-Lu
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Guard against non-numeric beacon
major/minor(#615 comment)RadarBeacon.major/.minorareStrings. The previousInt(beacon.major) ?? 0silently fell back to a0/0CLBeaconRegionwhen 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 existingproximityUUIDguard.Log skipped syncs (#615 comment)
useRadarModifiedBeaconearly returns and the tracking/options guard inreplaceSyncedBeaconUUIDsreturned silently. Added debug logs so it's clear when/why beacon syncing is skipped, matching the existing log inreplaceSyncedBeacons.Notes
0/0region; now skips it). Valid input is unchanged.