[webview_flutter] Only call onWebResourceError for main frame #3078
Conversation
Looks like this fell through the cracks. Could you add a version bump and resolve the conflict here? Other than that, it looks good to go. |
@@ -1146,8 +1146,48 @@ void main() { | |||
); | |||
|
|||
expect(errorCompleter.future, doesNotComplete); | |||
await Future.delayed(Duration(seconds: 5)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this when looking at the PR before; why is there a 5-second sleep at the end of these tests? At the very least this needs a clear comment, but is there really not some reliable thing we can wait for to do whatever this is intended to do, rather than relying on timing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I believed there was a chance for an error to occur after the page finished loading, but I just tested it and that doesn't look like the case for the url provided. I changed it to wait for onPageFinished
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
onWebResourceError
is called only for main frame on iOS and Android version below 23. This makes Android versions 23+ only use this callback for main frame as well.Related Issues
Fixes flutter/flutter#64925
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?