-
Notifications
You must be signed in to change notification settings - Fork 932
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
Add feed to isMalicious return type and update error page with feed info #5564
Add feed to isMalicious return type and update error page with feed info #5564
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b6d3050
to
31ef2ac
Compare
37a2b10
to
d297727
Compare
3948aaa
to
a2affdd
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.
LGTM
just few comments, nothin blocking.
Test cases worked fine. I've found an issue but unsure if related to changes here, so will share directly in Asana to triage.
app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/WebViewRequestInterceptor.kt
Show resolved
Hide resolved
...ain/kotlin/com/duckduckgo/malicioussiteprotection/impl/domain/RealMaliciousSiteProtection.kt
Outdated
Show resolved
Hide resolved
...ain/kotlin/com/duckduckgo/malicioussiteprotection/impl/domain/RealMaliciousSiteProtection.kt
Outdated
Show resolved
Hide resolved
...main/kotlin/com/duckduckgo/malicioussiteprotection/impl/data/network/MaliciousSiteService.kt
Outdated
Show resolved
Hide resolved
@@ -197,9 +242,12 @@ class RealMaliciousSiteBlockerWebViewIntegration @Inject constructor( | |||
processedUrls.clear() | |||
} | |||
|
|||
override fun onSiteExempted(url: Uri) { | |||
override fun onSiteExempted( |
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.
Can we add some test to this method? it seems they are missing. I was wondering about for example: what if url is not a valid URI?
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.
I can add some tests, but we don't do any validation. If the Uri is invalid, nothing will break, but it'll never get matched either. All URLs used in this case come from the WebView though, so they won't be invalid, and I don't think we should do validation in every single step of the way, as it would be terrible for performance.
val convertedUrl = URLDecoder.decode(url.toString(), "UTF-8").lowercase() | ||
exemptedUrlsHolder.exemptedMaliciousUrls.add(convertedUrl) | ||
exemptedUrlsHolder.exemptedMaliciousUrls.add(ExemptedUrl(convertedUrl.toUri(), feed)) |
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.
why receiving an url: Uri -> decoding to Url -> and converting to Uri again?
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 need to decode so we can match 2 URLs that are technically the same, but encoded differently. We could technically then store it as String, but after my experience working in performance, I prefer to use Uri whenever possible, and only rely on strings when necessary, as it's the case here
@SingleInstanceIn(AppScope::class) | ||
class ExemptedUrlsHolder @Inject constructor() { | ||
val exemptedMaliciousUrls = mutableSetOf<String>() | ||
val exemptedMaliciousUrls = mutableSetOf<ExemptedUrl>() |
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.
When checking how we use this, I don't see we ever check feed, only url. Do we have plans to differentiate exemptedUrls per feed?
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 don't check it here, but we need to be able to return both the URL and the feed, so that we can then setup the privacy dashboard for exempted sites, as the message shown is different depending on the feed that flagged the site
0e7fda2
to
7734cc1
Compare
… squashed commits) Squashed commits: [7734cc1] Scope exemptions to tab [7590760] Rename category to feed in network model [c37e012] Address PR comments [e21ffe9] Add missing progress [d4bee55] Scope exemptions to tab [0e07684] Fix failing tests [dd3e527] Fix tests [e78a107] Allow matches to recover from faulty category [ceafb2d] Add feed to isMalicious return type and integrate with error page
0e667cd
to
dc38d8c
Compare
Task/Issue URL: https://app.asana.com/0/1205008441501016/1209270355529418/f
Description
Add feed to isMalicious return type and update error page with feed info
Steps to test this PR
Feature 1
Feature 2
UI changes