Skip to content
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

Unify Configuration Management #990

Merged
merged 18 commits into from
Mar 8, 2023
Merged

Unify Configuration Management #990

merged 18 commits into from
Mar 8, 2023

Conversation

jaceklyp
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/72649045549333/1203797041821336/f
Tech Design URL:
CC: @bwaresiak

Description:
Use common API and Configuration modules located in BSK for fetching privacy related assets.
Add payload validation.

Steps to test this PR:

  1. Run tests
  2. Check if app downloads assets.
  3. Check if app sends etag in requests.
  4. Check if app handles 304s.
  5. Check if app stores the resources.

Internal references:

Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM

@ayoy ayoy self-assigned this Feb 23, 2023
Copy link
Collaborator

@ayoy ayoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good! I still need to do more testing, and read BSK, but I’m already leaving the comments that I have. Thanks @jaceklyp!

case .privacyConfiguration: return URL(string: "https://staticcdn.duckduckgo.com/trackerblocking/config/v2/macos-config.json")!
case .surrogates: return URL(string: "https://duckduckgo.com/contentblocking.js?l=surrogates")!
case .trackerDataSet: return URL(string: "https://staticcdn.duckduckgo.com/trackerblocking/v3/apple-tds.json")!
// In archived repo, to be refactored shortly (https://staticcdn.duckduckgo.com/useragents/social_ctp_configuration.json)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment still relevant? If so, can you make it more clear? (I have no idea what is it about)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea either - it's a one year old comment, and the original author is @ladamski. @ladamski do you know anything about that?

@@ -24,7 +24,7 @@ public struct UserDefaultsWrapper<T> {
public enum Key: String, CaseIterable {

case configLastUpdated = "config.last.updated"
case configStorageTrackerRadarEtag = "config.storage.trackerradar.etag"
case configStorageTrackerRadarEtag = "config.storage.trackerDataSet.etag"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't we need some migration code to recognize an etag stored under the old name?

#endif

Pixel.fire(.debug(event: .trackerDataCouldNotBeLoaded, error: error))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is getting fired on a fresh installation, I don't think it's intended.

Copy link
Collaborator

@ayoy ayoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great for me 👍 I’ve tested configuration fetching, ATB requests and feedback sending. Also verified that configuration fetching correctly happens in background queues. Great job @jaceklyp 💪

@github-actions
Copy link

github-actions bot commented Mar 7, 2023

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against ed207df

@ayoy ayoy assigned jaceklyp and unassigned ayoy Mar 8, 2023
jaceklyp added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Mar 8, 2023
Task/Issue URL: https://app.asana.com/0/72649045549333/1203797041821336/f
iOS PR: duckduckgo/iOS#1512
macOS PR: duckduckgo/macos-browser#990

Description:
Use common API and Configuration modules located in BSK for fetching privacy related assets.
Add payload validation.
@jaceklyp jaceklyp merged commit 46b744c into develop Mar 8, 2023
@jaceklyp jaceklyp deleted the jacek/unify-configuration branch March 8, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants