fix(windows): carry the requested URL on creation failures - #15
Merged
Y-PLONI merged 3 commits intoAug 28, 2026
Conversation
The failure stream is global, so a host with several webviews being created at once could not tell whose creation failed and would surface the error on an unrelated one. The requested URL is the only identifier both sides hold before the webview exists, so it is now reported alongside the error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #14, which merged before this commit landed on its branch.
Problem
WindowsWebViewCreationFailures.streamis global and the event carries no identifier. A host that creates several webviews concurrently — in Otzaria a background plugin host plus one or more plugin tabs, all starting at launch — cannot tell whose creation failed. One instance failing therefore surfaces the error on an unrelated pending webview, and tears down one whose own creation might still have succeeded.Change
WindowsWebViewCreationFailurenow carriesrequestedUrl, read back from the creation params (initialUrlRequest.url, falling back toinitialFile). It is the only identifier both sides hold before the webview exists, so it is what lets a host match a failure to its own request. Hosts that ignore the field are unaffected — the parameter is optional and defaults to null.Verification
flutter testinflutter_inappwebview_windows: 53 passed, including a new case asserting the URL reaches listeners.Consumer side: Otzaria/otzaria#1018 filters on this field; its CI is red until this merges.