-
Notifications
You must be signed in to change notification settings - Fork 934
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
Reenable blocklist experiment feature #5511
Conversation
@@ -3056,7 +3056,7 @@ class ContributesRemoteFeatureCodeGeneratorTest { | |||
"testFeature", | |||
""" | |||
{ | |||
"hash": "3", |
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.
While at it, fixed this test that was wrong.
06e709a
to
259d6a3
Compare
trackerDataDownloader.downloadTds() | ||
.subscribeOn(Schedulers.io()) |
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.
We weren't downloading anything before 🤦
@@ -40,7 +51,7 @@ class BlockListInterceptorApiPlugin constructor( | |||
override fun intercept(chain: Chain): Response { | |||
val request = chain.request().newBuilder() | |||
val url = chain.request().url | |||
if (!url.toString().contains(TDS_BASE_URL)) { | |||
if (url.toString() != TDS_URL) { |
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.
We now check the full TDS url rather than the base url.
chain.proceed(request.url("$TDS_BASE_URL$path").build()) | ||
chain.proceed(request.url("$TDS_BASE_URL$path").build()).also { response -> | ||
if (!response.isSuccessful) { | ||
pixel.fire(BLOCKLIST_TDS_FAILURE, mapOf("code" to response.code.toString())) |
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.
Sending a pixel if the path on the remote config is wrong and the request fails.
259d6a3
to
13496eb
Compare
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.
Tested, works as expected
const val TDS_BASE_URL = "https://staticcdn.duckduckgo.com/trackerblocking/" | ||
const val TDS_PATH = "v5/current/android-tds.json" | ||
const val TDS_URL = "$TDS_BASE_URL$TDS_PATH" |
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.
nit: I guess this can be reverted (removed) now (?)
Task/Issue URL: https://app.asana.com/0/488551667048375/1209138858416176/f
Description
This PR reenables the blocklist feature but this time checking the full tds URL rather than the base url only.
Steps to test this PR
https://www.jsonblob.com/api/1331667217611415552
for the remote configexperiment_enroll
pixel for the control and the eTag (app.db in tdsmetadata table) should match the one from https://staticcdn.duckduckgo.com/trackerblocking/v5/current/ios-tds.json currently is75cff4e36f76d9a81af0643d775008c9
something.json
, change the version and the hash from the blocklist too.blocklist_experiment_tds_download_failure
pixel with a corresponding error code.