Skip to content

Commit

Permalink
Fix check for deprecated clean sync key (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlw authored Jul 18, 2024
1 parent d54ec98 commit f4ec2d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/santasyncservice/SNTSyncPreflight.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions Source/santasyncservice/SNTSyncTest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4ec2d5

Please sign in to comment.