Skip to content

Conversation

@ShiCheng-Lu
Copy link
Contributor

@ShiCheng-Lu ShiCheng-Lu commented Sep 8, 2025

closed in favor of #492

Improve nearby geofence syncing logic

only remove/add when necessary to avoid removing and re-adding nearby geofences at each track.

Copilot AI review requested due to automatic review settings September 8, 2025 17:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the nearby geofence syncing logic to avoid unnecessarily removing and re-adding geofences at each track call. The changes implement a diff-based approach to only modify geofences and notifications when they actually differ from what's already monitored.

  • Replaces array-based registered notifications with set-based storage to avoid duplicates
  • Implements comparison methods to determine if regions and notifications are equivalent
  • Refactors syncing logic to only add/remove geofences and notifications when necessary

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
RadarSDK/RadarState.m Changes registered notifications storage from array to set to prevent duplicates
RadarSDK/RadarNotificationHelper.m Fixes indentation and refactors notification removal into separate method
RadarSDK/RadarNotificationHelper.h Adds method declarations for new notification helper functions
RadarSDK/RadarLocationManager.m Implements diff-based geofence and notification syncing with comparison methods
RadarSDK/RadarAPIClient.m Fixes incorrect parameter name in notification diff handling
RadarSDK.xcodeproj/project.pbxproj Downgrades Swift version from 6.0 to 5.0
Example/Pulse/ExportOptions.plist Adds new export configuration file
Example/Pulse/DistributionSummary.plist Adds new distribution summary file
Example/Example/MainView.swift Adds new SwiftUI view for debugging monitored regions and notifications
Example/Example/AppDelegate.swift Updates example app to support SwiftUI interface and removes test key
Example/Example.xcodeproj/project.pbxproj Adds MainView.swift to project build phases

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

//radarInitializeOptions.autoLogNotificationConversions = true
//radarInitializeOptions.autoHandleNotificationDeepLinks = true
Radar.initialize(publishableKey: "prj_test_pk_0000000000000000000000000000000000000000", options: radarInitializeOptions )
Radar.initialize(publishableKey: "prj_test_pk_", options: radarInitializeOptions )
Copy link

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

The publishable key appears to be incomplete or a placeholder. Ensure this is not accidentally committed to version control with a real key.

Copilot uses AI. Check for mistakes.
@lmeier lmeier changed the title Shicheng/improve sync logic Sync logic adjustments Sep 8, 2025
Copy link
Contributor

@KennyHuRadar KennyHuRadar left a comment

Choose a reason for hiding this comment

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

So from my understanding, we are trying to move away from the re-registering of CSGNs per track to improve reliability?

Why does the monitoring for nearby geofences also need to change?

@ShiCheng-Lu
Copy link
Contributor Author

prefer #492

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.

5 participants