Skip to content

Add update filter lists button #24828

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

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Add update filter lists button #24828

merged 2 commits into from
Jul 30, 2024

Conversation

cuba
Copy link
Contributor

@cuba cuba commented Jul 24, 2024

Resolves brave/brave-browser#35982

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  1. Go to filter lists
  2. Click on update filter lists button on custom filter list section
  3. click on update filter lists button on default filter lists section

Screenshots

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2024-07-25.at.09.41.37.mp4

@cuba cuba requested a review from a team as a code owner July 24, 2024 16:03
@cuba cuba force-pushed the js/updating-filter-lists branch from c51c256 to ff028b2 Compare July 24, 2024 17:37
@cuba cuba added CI/skip-android Do not run CI builds for Android CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-windows-x64 Do not run CI builds for Windows x64 CI/skip-macos-arm64 Do not run CI builds for macOS arm64 labels Jul 24, 2024
@cuba cuba force-pushed the js/updating-filter-lists branch 2 times, most recently from 9907afe to 80baf8e Compare July 26, 2024 13:55
Copy link
Collaborator

@kylehickinson kylehickinson left a comment

Choose a reason for hiding this comment

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

Is this just to avoid porting brave://components?

Comment on lines 45 to 51
var isUpdating: Bool {
return self == .updating
}

var isUpdated: Bool {
return self == .updated
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

These don't seem useful since your enum does not contain any associated values and thus can be compared directly

do {
try await FilterListCustomURLDownloader.shared.updateFilterLists()
} catch {
// Handle the error
Copy link
Collaborator

Choose a reason for hiding this comment

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

Error isn't handled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yah I should handle this. I put the comment but wasn't sure how to deal with it and forgot about it. Thanks for catching this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, however since Task.retry swallows errors, the catch will never be triggered. Will fix the issue with Task.retry separately.
Simulator Screenshot - iPhone 14 Pro - 2024-07-29 at 18 27 52

@@ -54,6 +54,27 @@ import Preferences
}
}

func updateFilterLists() async -> Bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will run on main, is that ok?

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 believe this should be fine. The method does this:

DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay then shit will require it always run on main then unless you use a task runner on the core side, if the @MainActor is ever removed from the parent type this will need to make sure its marked as MainActor again

@cuba cuba force-pushed the js/updating-filter-lists branch from 80baf8e to 5d504a0 Compare July 30, 2024 00:36
@cuba
Copy link
Contributor Author

cuba commented Jul 30, 2024

Is this just to avoid porting brave://components?

No we still want this. Desktop has it too. brave://components is for more "advanced" users

@cuba cuba requested a review from kylehickinson July 30, 2024 00:39
@cuba cuba merged commit c74ce05 into master Jul 30, 2024
21 checks passed
@cuba cuba deleted the js/updating-filter-lists branch July 30, 2024 20:46
@github-actions github-actions bot added this to the 1.70.x - Nightly milestone Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-macos-arm64 Do not run CI builds for macOS arm64 CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-windows-x64 Do not run CI builds for Windows x64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have a way to force-update adblock lists
2 participants