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

fix: Avoid showing error page on cancelled navigation #1483

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Aug 28, 2024

Platforms affected

iOS

Motivation and Context

Closes GH-959.

Description

If the navigation was cancelled, don't show an error page. This can cause issues where a subsequent request never loads into the webview because the error page is being shown.

This was previously implemented back in the UIWebView days as CB-13222 in #334 and was then proposed in apache/cordova-plugin-wkwebview-engine#84 for the WKWebView plugin, but that didn't get reviewed/merged before the repo was archived. The fix is still valid, so we'll port it to the current version of the WKWebView plugin.

Testing

All existing tests passed.

Checklist

  • I've run the tests to see all new and existing tests pass
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)

This was previously implemented back in the UIWebView days as CB-13222
in apache#334 and was then proposed
in apache/cordova-plugin-wkwebview-engine#84 for
the WKWebView plugin, but that didn't get reviewed/merged before the
repo was archived. The fix is still valid, so we'll port it to the
current version of the WKWebView plugin.

Closes apacheGH-959.

Co-Authored-By: Gwyn Judd <[email protected]>
@dpogue dpogue added this to the 8.0.0 milestone Aug 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.22%. Comparing base (458f5f3) to head (82933a8).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1483   +/-   ##
=======================================
  Coverage   80.22%   80.22%           
=======================================
  Files          16       16           
  Lines        1871     1871           
=======================================
  Hits         1501     1501           
  Misses        370      370           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

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

LGTM

@dpogue dpogue merged commit 8b60dca into apache:master Aug 29, 2024
10 checks passed
@dpogue dpogue deleted the nav-cancel branch August 29, 2024 10:13
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.

WKWebView cancelled request(NSURLErrorCancelled -999) leads to errorUrl page instead of the second request
3 participants