Skip to content

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Apr 24, 2019

Description

json_rpc_2 swallows exceptions. This can hide bugs in our callbacks, e.g. type conversion issues, which can result in an RPC call not doing what is expected.

This change hooks into a new parameter available that informs the caller of unhandled exceptions. For now, we just print them and assert(false). For Fuchsia debug protocol, we only print them.

Related Issues

Fixes #28531

Tests

The tests for this functionality exist upstream in the PR I wrote for json_rpc_2.

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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

}

void _unhandledJsonRpcError(dynamic error, dynamic stack) {

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intentionally blank?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, forgot to save. Will fix tonight

@dnfield
Copy link
Contributor Author

dnfield commented Apr 25, 2019

@jonahwilliams any idea on the builderOptions failures? Do we need to pin build_runner?

@jonahwilliams
Copy link
Contributor

We can pin it for now and I can handle rolling the changes

const Map<String, String> _kManuallyPinnedDependencies = <String, String>{
// Add pinned packages here.
'flutter_gallery_assets': '0.1.8', // See //examples/flutter_gallery/pubspec.yaml
'build_modules': '1.0.9', // TODO(jonahwilliams): migrate https://cirrus-ci.com/task/5747941259083776
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

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

@dnfield dnfield merged commit 1db5d66 into flutter:master Apr 25, 2019
@dnfield dnfield deleted the fix_json_rpc branch April 25, 2019 15:27
@dnfield
Copy link
Contributor Author

dnfield commented Apr 25, 2019

This spiked our tech debt benchmark for package deps, but didn't add any new deps...

@dnfield
Copy link
Contributor Author

dnfield commented Apr 25, 2019

It's because of the pinned dependency. That will go back down once we unpin the dep.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

json_rpc_2 is swallowing vmservice's exceptions

4 participants