-
Notifications
You must be signed in to change notification settings - Fork 425
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 error handling to contrainer removal #3424
Conversation
Core/WebCacheManager.swift
Outdated
// This should not be a problem as these containers are not supposed to be used anymore. | ||
// If this fails, we are going to still clean them next time as WebKit keeps track of all stores for us. | ||
if #available(iOS 17, *), !leftoverContainerIDs.isEmpty { | ||
DispatchQueue.main.asyncAfter(deadline: .now() + 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.
I'm a little worried about calling this on the main thread. This function doesn't need to. It will call back to the main thread, but the API suggests it can be called from any thread. Also, I think it'd be better if this was doing as a task rather than DispatchQueue, e.g.
Task {
try? await Task.sleep(interval: 3.0)
for uuid in leftoverContainerIDs {
try? await WKWebsiteDataStore.remove(forIdentifier: uuid)
}
}
That said, I'm going to approve because it does work so up to you if you want to tweak it.
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.
One comment with alternative Task based implementation suggestion.
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, thanks. Will merge.
# By Daniel Bernal (4) and others # Via Daniel Bernal (1) and others * main: Pixel retrying (#3358) Remove `voiceSearchHelper` from `AppDependencyProvider` (#3452) Update AutoClearSettingsViewController to use DI for app settings (#3448) Bump BSK (#3441) Remove `SubscriptionFeatureAvailability` from `AppDependencyProvider` (#3447) Release 7.141.0-2 (#3451) Do not notify the FE on experiment activation (#3450) point to bsk branch (#3444) bump bsk for content blocker rules fix (#3445) speculative fix for set bars visibility crashes (#3442) Release 7.141.0-1 (#3443) Fix browsing menu bottom offset when bar location set to bottom (#3440) Properly handle responses that should trigger download action (#3407) Add Events Firing for Phishing Detection Settings: Point to BSK (#3423) DuckPlayer: Temporary Fix for Watch In Youtube (#3437) Add 'Open in New Tab' support for DuckPlayer (#3431) update BSK dependency (#3434) Release 7.141.0-0 (#3435) Add error handling to contrainer removal (#3424) Prevent autofill prompt crash for edge case where a context menu is also visible on screen (#3417) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Task/Issue URL: https://app.asana.com/0/856498667320406/1207976962313181/f
Description:
Make sure the containers created recently or the ones that fail to be removed are given another chance to be cleaned.
Steps to test this PR:
Open the app, navigate to site that sets cookies, refresh, press fire button.
Smoke test data clearing, auto clear - both on app restart and time based one.
Test fireproofing on usage and after restart.
Definition of Done (Internal Only):
OS Testing:
Theme Testing:
Internal references:
Software Engineering Expectations
Technical Design Template