-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Fix multi-reply on message channel. Add test #17591
Conversation
| key: const Key('input'), | ||
| enabled: true, | ||
| controller: _controller, | ||
| //initialValue: 'Text1', |
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 this is a leftover from my code. I also saw it yesterday. Can you remove this line :)
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.
Clarified why we need text field with comment.
| void main() async { | ||
| E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; | ||
|
|
||
| testWidgets('platform message for Clipboard.set/getData reply with future', |
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.
nit: Rename the test. I think we only tests the setData here.
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.
Done.
| }).catchError((dynamic _) { | ||
| callback(codec.encodeErrorEnvelope( | ||
| code: 'copy_fail', message: 'Clipboard.setData failed')); | ||
| // Don't encode a duplicate reply if we already failed and an error |
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.
thanks!
| callback(codec.encodeErrorEnvelope( | ||
| code: 'copy_fail', message: 'Clipboard.setData failed')); | ||
| errorEnvelopeEncoded = true; |
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.
There's no error thrown here. Why would the catchError callback be invoked after this?
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.
When you do the error reply, the code that handles it could/did crash, then that is caught and instead of stack trace of error handling code that failed, you get the multi-reply failure.
ditman
left a comment
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.
Thanks for the fix!!
e2etests/web/regular_integration_tests/test_driver/platform_messages_e2e.dart
Show resolved
Hide resolved
* Fix multi-reply on message channel. Add test * Add check for viewInstanceCount * skip no-headless test
Related issue: flutter/flutter#53367