Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@ueman
Copy link
Contributor

@ueman ueman commented Jul 1, 2022

I'm currently writing an integration which reports PlatformDispatcher.onError errors 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

typedef ErrorCallback = bool Function(Object exception, StackTrace stackTrace);

and on dart:web_ui it's

typedef ErrorCallback = bool Function(Object exception, StackTrace? stackTrace);

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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

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

@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Jul 1, 2022
@flutter-dashboard
Copy link

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.

@dnfield
Copy link
Contributor

dnfield commented Jul 1, 2022

This was a mistake. @jonahwilliams or @yjbanov could the api conformance check catch this?

@jonahwilliams
Copy link
Contributor

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);
Copy link
Contributor Author

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

@ueman
Copy link
Contributor Author

ueman commented Jul 6, 2022

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.');
Copy link
Contributor Author

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.

@dnfield dnfield added autosubmit Merge PR when tree becomes green via auto submit App and removed needs tests labels Jul 6, 2022
@auto-submit
Copy link
Contributor

auto-submit bot commented Jul 6, 2022

  • Please get at least one approved review if you are already a member or two member reviews if you are not a member before re-applying this label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@auto-submit
Copy link
Contributor

auto-submit bot commented Jul 6, 2022

Validations Fail.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 6, 2022
@dnfield dnfield requested review from jonahwilliams and yjbanov July 6, 2022 20:05
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 6, 2022
@auto-submit
Copy link
Contributor

auto-submit bot commented Jul 6, 2022

  • The status or check suite Windows Host Engine has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Mac iOS Engine has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux Web Engine has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux clang-tidy has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux Unopt has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux Host Engine has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux Fuchsia FEMU has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux Benchmarks (no-upload) has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux Android Debug Engine has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux Android AOT Engine has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux Web Framework tests has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite Linux Framework Smoke Tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 6, 2022
@ueman
Copy link
Contributor Author

ueman commented Jul 7, 2022

@dnfield friendly ping to add the autosubmit label once again. I've merged latest main into this PR and CI now seems to be happy again.

@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 7, 2022
@auto-submit auto-submit bot merged commit 1276049 into flutter:main Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API conformance check has problems with nullable types

3 participants