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

Fixing WKNavigationDelegateProxy #110

Merged
merged 3 commits into from
Nov 5, 2024
Merged

Conversation

NachoEmbrace
Copy link
Contributor

@NachoEmbrace NachoEmbrace commented Oct 30, 2024

We were implementing every method of the WKNavigationDelegate protocol which could cause issues when the original delegates didn't have an implementation.

This PR removes the implementations for methods that were not being used, and the forwarding is now handled by overriding responds(to:) and forwardingTarget(for:).

This is the same solution that we used in our URLSessionDelegateProxy.

@NachoEmbrace NachoEmbrace requested a review from a team as a code owner October 30, 2024 18:36
Copy link

github-actions bot commented Oct 30, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

delegate.webView?(webView, didFinish: navigation)
delegate.webView?(webView, didReceive: URLAuthenticationChallenge(), completionHandler: block3)
delegate.webViewWebContentProcessDidTerminate?(webView)
delegate.webView?(webView, authenticationChallenge: URLAuthenticationChallenge(), shouldAllowDeprecatedTLS: block4)

Choose a reason for hiding this comment

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

  • ⚠️ Line should be 120 characters or less; currently it has 123 characters (line_length)

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.84%. Comparing base (b2da5ac) to head (a902c9b).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...re/Capture/WebView/WKNavigationDelegateProxy.swift 87.50% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #110      +/-   ##
==========================================
- Coverage   91.95%   91.84%   -0.12%     
==========================================
  Files         408      410       +2     
  Lines       26457    26459       +2     
==========================================
- Hits        24329    24300      -29     
- Misses       2128     2159      +31     
Files with missing lines Coverage Δ
...pture/WebView/WKNavigationDelegateProxyTests.swift 100.00% <100.00%> (ø)
...re/Capture/WebView/WKNavigationDelegateProxy.swift 92.85% <87.50%> (-5.76%) ⬇️

... and 6 files with indirect coverage changes

@NachoEmbrace NachoEmbrace merged commit 3120f2b into main Nov 5, 2024
10 checks passed
@NachoEmbrace NachoEmbrace deleted the webview_capture_service_fix branch November 5, 2024 15:18
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