From f4ec2d51abce3fe185763c49d28b0b045d592388 Mon Sep 17 00:00:00 2001 From: Matt W <436037+mlw@users.noreply.github.com> Date: Wed, 17 Jul 2024 20:10:38 -0400 Subject: [PATCH] Fix check for deprecated clean sync key (#1397) --- Source/santasyncservice/SNTSyncPreflight.mm | 2 +- Source/santasyncservice/SNTSyncTest.mm | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/santasyncservice/SNTSyncPreflight.mm b/Source/santasyncservice/SNTSyncPreflight.mm index 649c61b5f..b9c7d5488 100644 --- a/Source/santasyncservice/SNTSyncPreflight.mm +++ b/Source/santasyncservice/SNTSyncPreflight.mm @@ -250,7 +250,7 @@ - (BOOL)sync { case ::pbv1::NORMAL: // Intentional fallthrough default: self.syncState.syncType = SNTSyncTypeNormal; break; } - } else if (resp.has_deprecated_clean_sync()) { + } else if (resp.deprecated_clean_sync()) { // If the deprecated key is set, the type of sync clean performed should be // the type that was requested. This must be set appropriately so that it // can be propagated during the Rule Download stage so SNTRuleTable knows diff --git a/Source/santasyncservice/SNTSyncTest.mm b/Source/santasyncservice/SNTSyncTest.mm index 884ddc265..c93d0e829 100644 --- a/Source/santasyncservice/SNTSyncTest.mm +++ b/Source/santasyncservice/SNTSyncTest.mm @@ -579,6 +579,13 @@ - (void)testPreflightStateCleanAllRequestCleanResponseCleanDep { response:@{kCleanSyncDeprecated : @YES}]; } +- (void)testPreflightStateNormalRequestNormalResponseCleanDep { + [self cleanSyncPreflightRequiredSyncType:SNTSyncTypeNormal + expectcleanSyncRequest:NO + expectedSyncType:SNTSyncTypeNormal + response:@{kCleanSyncDeprecated : @NO}]; +} + - (void)testPreflightStateCleanAllRequestCleanResponseUnknown { [self cleanSyncPreflightRequiredSyncType:SNTSyncTypeCleanAll expectcleanSyncRequest:YES