-
Notifications
You must be signed in to change notification settings - Fork 16
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
DBP: Restructure AgentManager and scheduler and add tests #2777
Merged
THISISDINOSAUR
merged 39 commits into
feature/pir-stabilization
from
elle/dbp-agentmanager-and-scheduler
May 15, 2024
Merged
Changes from 32 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
8457fae
Rebase merge
aataraxiaa 7f6234a
Rebase merge
aataraxiaa d4386f4
Rebase merge
aataraxiaa bd76677
Rebase merge
aataraxiaa 4c555b1
Refactor DataBrokerOperation dependency definition, usage
aataraxiaa 926b53e
Update Builder test post-refactor
aataraxiaa 2170a1d
Rebase merge
aataraxiaa f3468a6
Initial implementation of `DataBrokerProtectionQueueManager` & `DataB…
aataraxiaa 35aef1c
Post-rebase manual fixes
aataraxiaa 699ff01
Rebase merge: Scheduler
aataraxiaa 13c1ae1
Add tests & mocks
aataraxiaa 6f19c1e
Remove debug command enum, protocol, and usage
aataraxiaa 76dabb9
Correct log message
aataraxiaa 6c4a23b
Post-rebase updates/fixes
aataraxiaa 5de0f3c
PR Feedback Part 1
aataraxiaa ec93899
PR Feedback: Fire pixels in queue manager, clear errors on completion…
aataraxiaa 74b6cc2
PR Feedback: Rename `provide` method
aataraxiaa a1283af
PR Feedback: Avoid side-effects, rename errorCollection, and add test
aataraxiaa a995cb3
Swiftlint
aataraxiaa f7909d6
Merge agentManager and scheduler
THISISDINOSAUR e72e05b
Refactor AgentManager to enable testability
THISISDINOSAUR be40496
Make IPC server testable
THISISDINOSAUR e227ed6
Add mocks for tests and rename MockUserNotification to MockUserNotifi…
THISISDINOSAUR b19d9e3
Add AgentManager tests
THISISDINOSAUR 0698622
Update agent manager log statements
THISISDINOSAUR 1f80248
Remove out of date comment
THISISDINOSAUR 8f10093
Merge branch 'feature/pir-stabilization' into elle/dbp-agentmanager-a…
THISISDINOSAUR 99ea6aa
Integrate new and renamed debug commands
THISISDINOSAUR 901bf4f
Add debug running status string back
THISISDINOSAUR 2b5e863
Update references to manual and restore debug run state
THISISDINOSAUR e2f29a5
Fix another reference to manual
THISISDINOSAUR 1bb4a1f
Move scheduler config into config struct
THISISDINOSAUR eddab4b
Fix agent manager not being persisted in memory
THISISDINOSAUR a00aeea
Fix not calling app launched
THISISDINOSAUR 028d561
Add interrupted error to queueManager
THISISDINOSAUR 24a43ae
Add delay to profile saved call to make sure agent has started
THISISDINOSAUR c1c2ebd
Add pixels
THISISDINOSAUR 9b5940a
Fix interrupt error
THISISDINOSAUR 7a753dc
Add interrupt to unit tests
THISISDINOSAUR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,8 @@ | |
import DataBrokerProtection | ||
import Common | ||
|
||
protocol DataBrokerProtectionLoginItemInterface: DataBrokerProtectionAgentInterface { | ||
func disableLoginItem() | ||
func enableLoginItem() | ||
protocol DataBrokerProtectionLoginItemInterface: DataBrokerProtectionAppToAgentInterface { | ||
func dataDeleted() | ||
} | ||
|
||
/// Launches a login item and then communicates with it through IPC | ||
|
@@ -43,35 +42,35 @@ | |
|
||
// MARK: - Login Item Management | ||
|
||
func disableLoginItem() { | ||
private func disableLoginItem() { | ||
DataBrokerProtectionLoginItemPixels.fire(pixel: GeneralPixel.dataBrokerDisableLoginItemDaily, frequency: .daily) | ||
loginItemsManager.disableLoginItems([.dbpBackgroundAgent]) | ||
} | ||
|
||
func enableLoginItem() { | ||
private func enableLoginItem() { | ||
DataBrokerProtectionLoginItemPixels.fire(pixel: GeneralPixel.dataBrokerEnableLoginItemDaily, frequency: .daily) | ||
loginItemsManager.enableLoginItems([.dbpBackgroundAgent], log: .dbp) | ||
} | ||
|
||
// MARK: - DataBrokerProtectionAgentInterface | ||
// MARK: - DataBrokerProtectionLoginItemInterface | ||
|
||
func dataDeleted() { | ||
disableLoginItem() | ||
} | ||
|
||
// MARK: - DataBrokerProtectionAppToAgentInterface | ||
// MARK: - DataBrokerProtectionAgentAppEvents | ||
|
||
func profileSaved() { | ||
enableLoginItem() | ||
ipcClient.profileSaved { error in | ||
// TODO | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the pixels that are pending |
||
} | ||
|
||
func dataDeleted() { | ||
ipcClient.dataDeleted { error in | ||
// TODO | ||
} | ||
} | ||
|
||
func appLaunched() { | ||
ipcClient.appLaunched { error in | ||
// TODO | ||
} | ||
} | ||
|
||
|
165 changes: 0 additions & 165 deletions
165
DuckDuckGoDBPBackgroundAgent/DataBrokerProtectionAgentManager.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳