Skip to content

Rename flag for disabling remote commands #1929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Common/FeatureFlags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct FeatureFlagConfiguration: Decodable {
let observeHealthKitCarbSamplesFromOtherApps: Bool
let observeHealthKitDoseSamplesFromOtherApps: Bool
let observeHealthKitGlucoseSamplesFromOtherApps: Bool
let remoteOverridesEnabled: Bool
let remoteCommandsEnabled: Bool
let predictedGlucoseChartClampEnabled: Bool
let scenariosEnabled: Bool
let sensitivityOverridesEnabled: Bool
Expand Down Expand Up @@ -161,10 +161,10 @@ struct FeatureFlagConfiguration: Decodable {
#endif

// Swift compiler config is inverse, since the default state is enabled.
#if REMOTE_OVERRIDES_DISABLED
self.remoteOverridesEnabled = false
#if REMOTE_COMMANDS_DISABLED || REMOTE_OVERRIDES_DISABLED //REMOTE_OVERRIDES_DISABLED: backwards compatibility of Loop 3 & prior
self.remoteCommandsEnabled = false
#else
self.remoteOverridesEnabled = true
self.remoteCommandsEnabled = true
#endif

#if SCENARIOS_ENABLED
Expand Down Expand Up @@ -240,7 +240,7 @@ extension FeatureFlagConfiguration : CustomDebugStringConvertible {
"* observeHealthKitDoseSamplesFromOtherApps: \(observeHealthKitDoseSamplesFromOtherApps)",
"* observeHealthKitGlucoseSamplesFromOtherApps: \(observeHealthKitGlucoseSamplesFromOtherApps)",
"* predictedGlucoseChartClampEnabled: \(predictedGlucoseChartClampEnabled)",
"* remoteOverridesEnabled: \(remoteOverridesEnabled)",
"* remoteCommandsEnabled: \(remoteCommandsEnabled)",
"* scenariosEnabled: \(scenariosEnabled)",
"* sensitivityOverridesEnabled: \(sensitivityOverridesEnabled)",
"* showEventualBloodGlucoseOnWatchEnabled: \(showEventualBloodGlucoseOnWatchEnabled)",
Expand Down
4 changes: 2 additions & 2 deletions Loop/Managers/DeviceDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1347,8 +1347,8 @@ extension DeviceDataManager {
log.default("Remote Notification: Finished handling")
}

guard FeatureFlags.remoteOverridesEnabled else {
log.error("Remote Notification: Overrides not enabled.")
guard FeatureFlags.remoteCommandsEnabled else {
log.error("Remote Notification: Remote Commands not enabled.")
return
}

Expand Down
2 changes: 1 addition & 1 deletion Loop/Managers/LoopAppManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class LoopAppManager: NSObject {

registerBackgroundTasks()

if FeatureFlags.remoteOverridesEnabled {
if FeatureFlags.remoteCommandsEnabled {
DispatchQueue.main.async {
#if targetEnvironment(simulator)
self.remoteNotificationRegistrationDidFinish(.failure(SimulatorError.remoteNotificationsNotAvailable))
Expand Down
2 changes: 1 addition & 1 deletion Loop/Managers/SettingsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class SettingsManager {

latestSettings = mergedSettings

if remoteNotificationRegistrationResult == nil && FeatureFlags.remoteOverridesEnabled {
if remoteNotificationRegistrationResult == nil && FeatureFlags.remoteCommandsEnabled {
// remote notification registration not finished
return
}
Expand Down