Skip to content

[webview_flutter_wkwebview] Updates plugin for iOS 26#11415

Merged
auto-submit[bot] merged 7 commits intoflutter:mainfrom
bparrishMines:wkwebview_frame
Apr 9, 2026
Merged

[webview_flutter_wkwebview] Updates plugin for iOS 26#11415
auto-submit[bot] merged 7 commits intoflutter:mainfrom
bparrishMines:wkwebview_frame

Conversation

@bparrishMines
Copy link
Copy Markdown
Contributor

@bparrishMines bparrishMines commented Apr 1, 2026

  1. Prevents test WKFrameInfo from deallocating during tests to prevent crash
  2. Retrieves failing url from DNS failures from NSURLErrorFailingURLErrorKey.

Fixes flutter/flutter#182846

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@bparrishMines bparrishMines changed the title Wkwebview frame [webview_flutter_wkwebview] Prevents test WKFrameInfo from deallocating during tests to prevent crash Apr 1, 2026
@bparrishMines bparrishMines added the CICD Run CI/CD label Apr 1, 2026
@bparrishMines bparrishMines marked this pull request as ready for review April 1, 2026 21:07
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors unit tests in the WKWebView package to use static instances of TestFrameInfo and TestFrameInfoWithNilRequest to prevent crashes during deallocation on newer iOS versions. The review feedback identifies a recurring typo in the code comments where 'iOS 26+' is cited instead of the correct iOS version.

@bparrishMines
Copy link
Copy Markdown
Contributor Author

@okorohelijah @vashworth I believe this fixes flutter/flutter#182846, so feel free to try or use this when upgrading CI to iOS 26. The tests pass when I run it locally on iOS 26 with Xcode 26.4 with this change.

@stuartmorgan-g stuartmorgan-g added the triage-ios Should be looked at in iOS triage label Apr 7, 2026
@okorohelijah
Copy link
Copy Markdown
Contributor

okorohelijah commented Apr 8, 2026

@bparrishMines Thanks for taking a look! I was able to test these changes on CI PR #10635 and can confirm they resolve the crash.

However a separate integration test failure appeared in NavigationDelegate onWebResourceError. It looks like on iOS 26+, NSError.userInfo no longer includes the NSURLErrorFailingURLStringKey for DNS failures, causing error.url to be null and failing the current assertion:
expect(error.url?.startsWith('https://www.notawebsite..com'), isTrue)

Since the fix is just a small adjustment (checking the URL only if it's non-null), I thought it might be worth including here

Would you be open to including that fix in this PR, or would you prefer I keep it separate? wdyt?

Build: https://ci.chromium.org/ui/p/flutter/builders/try/Mac_arm64%20ios_platform_tests_shard_5%20master/28011/overview

log: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8685256132893502657/+/u/Run_package_tests/drive_examples/stdout?format=raw

@bparrishMines bparrishMines added CICD Run CI/CD and removed CICD Run CI/CD labels Apr 9, 2026
@bparrishMines bparrishMines changed the title [webview_flutter_wkwebview] Prevents test WKFrameInfo from deallocating during tests to prevent crash [webview_flutter_wkwebview] Updates plugin for iOS 26 Apr 9, 2026
@bparrishMines
Copy link
Copy Markdown
Contributor Author

bparrishMines commented Apr 9, 2026

However a separate integration test failure appeared in NavigationDelegate onWebResourceError. It looks like on iOS 26+, NSError.userInfo no longer includes the NSURLErrorFailingURLStringKey for DNS failures, causing error.url to be null and failing the current assertion:
expect(error.url?.startsWith('https://www.notawebsite..com'), isTrue)

@okorohelijah I was able to reproduce the integration test failure locally, so I did some investigation and found the failing url is now in a new key for iOS 26. So I just updated the PR to handle using the new key if the old one doesn't work.

@github-actions github-actions bot removed the CICD Run CI/CD label Apr 9, 2026
Copy link
Copy Markdown
Contributor

@okorohelijah okorohelijah left a comment

Choose a reason for hiding this comment

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

LGTM✅

@okorohelijah okorohelijah added the CICD Run CI/CD label Apr 9, 2026
@vashworth vashworth added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 9, 2026
@auto-submit auto-submit bot merged commit 62949f4 into flutter:main Apr 9, 2026
82 checks passed
@bparrishMines bparrishMines deleted the wkwebview_frame branch April 9, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: webview_flutter platform-ios platform-macos triage-ios Should be looked at in iOS triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[webview_flutter_wkwebview] native tests crashing/restarting on ios 26

4 participants