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

DBP: Fix memory leak on WebViewHandler #2483

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

jotaemepereira
Copy link
Collaborator

Task/Issue URL: https://app.asana.com/0/1204006570077678/1206888925019546/f
Tech Design URL:
CC:

Description:
Removes the leaking Task.sleep on WebViewHandler which was causing The operation couldn’t be completed. No space left on device

Steps to test this PR:

  1. Run multiple scans and opt-outs if possible
  2. Check that there is no The operation couldn’t be completed. No space left on device or weird scenarios happening.

@github-actions github-actions bot added the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Mar 22, 2024
@@ -186,7 +186,9 @@ extension DataBrokerOperation {
switch actionType {
case .click:
stageCalculator?.fireOptOutFillForm()
try? await webViewHandler?.waitForWebViewLoad(timeoutInSeconds: 30)
try? await webViewHandler?.waitForWebViewLoad()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Bunn This is a collateral change of removing the timeout. We were doing similar for clicks, what I’m doing there now is waiting 10 seconds before tapping.

We will probably need the same retry function that is now on C-S-S with clicks, but because clicks are done in opt-out, I think it makes sense to do it after launch.

@github-actions github-actions bot removed the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Mar 22, 2024
@@ -59,7 +59,11 @@ final class DataBrokerProtectionWebViewHandler: NSObject, WebViewHandler {
}

func initializeWebView(showWebView: Bool) async {
webView = WebView(frame: CGRect(origin: .zero, size: CGSize(width: 1024, height: 1024)), configuration: webViewConfiguration)
guard let configuration = self.webViewConfiguration else {
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add an assert here?

Copy link
Collaborator

@Bunn Bunn left a comment

Choose a reason for hiding this comment

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

LGTM

@jotaemepereira jotaemepereira merged commit 66fdc78 into main Mar 22, 2024
16 of 17 checks passed
@jotaemepereira jotaemepereira deleted the juan/dbp/fix-memory-leak-web-view-handler branch March 22, 2024 21:32
samsymons added a commit that referenced this pull request Mar 22, 2024
* main:
  BrowserServicesKit bump to 129.1.4 (#2487)
  DBP: Fix memory leak on WebViewHandler (#2483)
  Invalidate user cache (#2486)
  Rework the caching logic for subscription and entitlements (#2485)
  Fix expiry prompt uninstall button selection state (#2475)
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.

2 participants