fix(ios): restore missing location monitor merge files#18260
Conversation
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
| func stopLocationUpdates() { | ||
| guard self.isStreaming else { return } | ||
| self.isStreaming = false | ||
| self.manager.stopUpdatingLocation() | ||
| self.manager.stopMonitoringSignificantLocationChanges() | ||
| self.updatesContinuation?.finish() | ||
| self.updatesContinuation = nil | ||
| } |
There was a problem hiding this comment.
calling manager.stopMonitoringSignificantLocationChanges() here will also stop significant location monitoring started via startMonitoringSignificantLocationChanges() (line 147-151), even when isMonitoringSignificantChanges is true
| func stopLocationUpdates() { | |
| guard self.isStreaming else { return } | |
| self.isStreaming = false | |
| self.manager.stopUpdatingLocation() | |
| self.manager.stopMonitoringSignificantLocationChanges() | |
| self.updatesContinuation?.finish() | |
| self.updatesContinuation = nil | |
| } | |
| func stopLocationUpdates() { | |
| guard self.isStreaming else { return } | |
| self.isStreaming = false | |
| self.manager.stopUpdatingLocation() | |
| if !self.isMonitoringSignificantChanges { | |
| self.manager.stopMonitoringSignificantLocationChanges() | |
| } | |
| self.updatesContinuation?.finish() | |
| self.updatesContinuation = nil | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/ios/Sources/Location/LocationService.swift
Line: 138:145
Comment:
calling `manager.stopMonitoringSignificantLocationChanges()` here will also stop significant location monitoring started via `startMonitoringSignificantLocationChanges()` (line 147-151), even when `isMonitoringSignificantChanges` is true
```suggestion
func stopLocationUpdates() {
guard self.isStreaming else { return }
self.isStreaming = false
self.manager.stopUpdatingLocation()
if !self.isMonitoringSignificantChanges {
self.manager.stopMonitoringSignificantLocationChanges()
}
self.updatesContinuation?.finish()
self.updatesContinuation = nil
}
```
How can I resolve this? If you propose a fix, please make it concise.9c0974a to
cdb8a10
Compare
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
cdb8a10 to
bb4c6ea
Compare
bb4c6ea to
ec7d390
Compare
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
1 similar comment
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
ec7d390 to
14b688d
Compare
14b688d to
f60cd10
Compare
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f60cd10 Co-authored-by: ngutman <[email protected]> Co-authored-by: ngutman <[email protected]> Reviewed-by: @ngutman
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f60cd10 Co-authored-by: ngutman <[email protected]> Co-authored-by: ngutman <[email protected]> Reviewed-by: @ngutman (cherry picked from commit 5a39e13) # Conflicts: # CHANGELOG.md # apps/ios/Sources/Info.plist # apps/ios/Sources/Status/StatusActivityBuilder.swift
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f60cd10 Co-authored-by: ngutman <[email protected]> Co-authored-by: ngutman <[email protected]> Reviewed-by: @ngutman (cherry picked from commit 5a39e13) # Conflicts: # CHANGELOG.md # apps/ios/Sources/Info.plist # apps/ios/Sources/Status/StatusActivityBuilder.swift
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f60cd10 Co-authored-by: ngutman <[email protected]> Co-authored-by: ngutman <[email protected]> Reviewed-by: @ngutman
Summary
NodeAppModelreferencedSignificantLocationMonitor.startIfNeeded(...), but merge tomainmissed the corresponding iOS location monitor files/protocol methods.pnpm ios:buildfailed withcannot find 'SignificantLocationMonitor' in scope.ios-new-alpha-core, plus the Info.plist ATS key used there.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
NSAllowsArbitraryLoadsInWebContent(as inios-new-alpha-core).Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
pnpm ios:build.Expected
Actual
** BUILD SUCCEEDED **).Evidence
Human Verification (required)
ios-new-alpha-core, rebuilt iOS app.@MainActortoStatusActivityBuilder.buildunder Swift 6 actor isolation.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
apps/ios/Sources/Info.plistapps/ios/Sources/Location/LocationService.swiftapps/ios/Sources/Location/SignificantLocationMonitor.swiftapps/ios/Sources/Services/NodeServiceProtocols.swiftapps/ios/Sources/Status/StatusActivityBuilder.swiftSignificantLocationMonitorStatusActivityBuilderRisks and Mitigations
ios-new-alpha-corebehavior and is scoped to iOS Info.plist only.Greptile Summary
This PR restores iOS location monitor files (
SignificantLocationMonitor.swift) and protocol methods that were missing after a merge tomain, fixing the build failure. The implementation adds location monitoring functionality to track significant location changes and push events to the gateway for severance hook processing.Key changes:
SignificantLocationMonitorenum withstartIfNeeded()method referenced byNodeAppModelLocationServicingfor location streaming and significant change monitoringLocationServicewith callback-based and stream-based location monitoringNSAllowsLocalNetworkingtoNSAllowsArbitraryLoadsInWebContentto matchios-new-alpha-coreStatusActivityBuilder.buildas@MainActorto satisfy Swift 6 actor isolationThe restored implementation appears to match the original from
ios-new-alpha-core. One logic issue was identified where stopping location stream updates could interfere with callback-based significant change monitoring when both are active simultaneously.Confidence Score: 4/5
ios-new-alpha-core. Score reduced from 5 to 4 due to a state management issue inLocationService.stopLocationUpdates()where stopping stream updates could inadvertently stop callback-based significant change monitoring when both mechanisms are activeapps/ios/Sources/Location/LocationService.swiftfor the state management fix instopLocationUpdates()Last reviewed commit: 9c0974a