-
Notifications
You must be signed in to change notification settings - Fork 6k
Consolidate method signature for PlatformDispatcher.onError
#34428
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
This was a mistake. @jonahwilliams or @yjbanov could the api conformance check catch this? |
|
I'm not sure, I haven't touched it since pre-null safety. I would just update the web ui version. The dart:ui signature is what is used for analysis. |
| typedef TimingsCallback = void Function(List<FrameTiming> timings); | ||
| typedef PointerDataPacketCallback = void Function(PointerDataPacket packet); | ||
| typedef KeyDataCallback = bool Function(KeyData packet); | ||
| typedef KeyDataCallback = bool Function(KeyData data); |
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.
This was caught by the new typedef conformance check
|
I've added a conformance check for typedef and also for nullability. Since this is my first time working with the analyzer, I'm pretty sure that this can be improved. |
| } | ||
| } | ||
| } | ||
| print('Checking ${uiTypeDefs.length} typedefs.'); |
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 tried to make the typedef check as similar to the method check as possible. So we check for all the same problems.
|
|
Validations Fail. |
jonahwilliams
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.
LGTM
|
|
@dnfield friendly ping to add the |
I'm currently writing an integration which reports
PlatformDispatcher.onErrorerrors directly to Sentry, see getsentry/sentry-dart#915.During that process, I've noticed that the method signatures differ between web and Dart:IO.
I'm pretty sure the method signature should be the same on both platforms.
On dart:ui it's
engine/lib/ui/platform_dispatcher.dart
Line 64 in 28a5d3c
and on dart:web_ui it's
engine/lib/web_ui/lib/platform_dispatcher.dart
Line 17 in 28a5d3c
This PR consolidates the callback to
typedef ErrorCallback = bool Function(Object exception, StackTrace stackTrace);.I guess this should have a test, but I'm not sure what the right approach for that is. @dnfield do you have an idea, since you've written the original implementation?
List which issues are fixed by this PR. You must list at least one issue.
This helps with getsentry/sentry-dart#915. The issue this PR fixes is not really complicated, so I hope that's enough. Otherwise, I'm happy to create an issue.
This also fixes flutter/flutter#107035
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
No, this is not a breaking change.
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.