Skip to content

Conversation

@jakemac53
Copy link
Contributor

@jakemac53 jakemac53 commented Jul 29, 2025

Adds more descriptive ArgumentErrors to flutter driver deserialization methods for commands and finders.

Also adds support for the normal defaults to the deserialization handlers (can revert this if you like, but it helps when interacting with flutter driver as a client so that it is more similar to how the API works).

The tests aren't completely exhaustive as that would get very verbose, but they do cover a variety of use cases.

Fixes #172127

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], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@jakemac53 jakemac53 requested a review from matanlurey as a code owner July 29, 2025 21:27
@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) labels Jul 29, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves the deserialization logic in flutter_driver by adding more descriptive ArgumentErrors and support for default values, making the API more robust and easier to debug. The introduction of a path parameter for tracking the location of deserialization errors in nested structures is a particularly valuable enhancement. The accompanying tests are thorough and cover the new functionality well.

I've provided a couple of minor suggestions to further refine the new error handling and its corresponding tests. Overall, this is an excellent and well-executed contribution.

@jakemac53 jakemac53 force-pushed the flutter-driver-deserialization branch from d3d6665 to 7bd1ddc Compare July 29, 2025 21:30
Copy link
Contributor

@matanlurey matanlurey left a comment

Choose a reason for hiding this comment

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

LGTM sorry for the delay (OOO)

@chunhtai chunhtai removed the a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) label Aug 13, 2025
@github-actions github-actions bot added the a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) label Aug 18, 2025
@jakemac53 jakemac53 enabled auto-merge August 18, 2025 15:52
@jakemac53 jakemac53 disabled auto-merge August 18, 2025 16:43
@jakemac53
Copy link
Contributor Author

jakemac53 commented Aug 18, 2025

cc @matanlurey PTAL at the small change I made, I removed the path argument from FinderExtension.deserialize - this wasn't necessary and was actually an accidental breaking change since that method is intended to be implemented by user implementations.

@chunhtai chunhtai requested a review from matanlurey August 27, 2025 21:39
Copy link
Contributor

@matanlurey matanlurey left a comment

Choose a reason for hiding this comment

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

LGTM.

@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 27, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Aug 27, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 2, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 2, 2025
Roll Flutter from da5523afc3c1 to 6b18740d5a23 (49 revisions)

flutter/flutter@da5523a...6b18740

2025-08-29 [email protected] Roll Dart SDK from 11f6cd99f6b3 to 72cda0f3dc42 (2 revisions) (flutter/flutter#174697)
2025-08-29 [email protected] Fix empty adaptive text selection toolbars building. (flutter/flutter#174656)
2025-08-29 [email protected] [flutter_test] update the _isImportantForAccessibility method in SemanticsController to include tooltip (flutter/flutter#174476)
2025-08-29 [email protected] Roll Skia from 89794f0b5384 to 43e79dc80ca8 (1 revision) (flutter/flutter#174678)
2025-08-29 [email protected] Roll Skia from f3c8b4c677f5 to 89794f0b5384 (6 revisions) (flutter/flutter#174675)
2025-08-29 [email protected] Implement Overlay.of with inherited widget (flutter/flutter#174315)
2025-08-29 [email protected] [impeller] Support partitioned host buffer (flutter/flutter#174463)
2025-08-29 [email protected] Adds semantics for disabled buttons in date picker (flutter/flutter#174064)
2025-08-29 [email protected] Roll Fuchsia Linux SDK from bHYRvLv2Dg56RWZF2... to 00VSr-5B7hq0G2eZx... (flutter/flutter#174667)
2025-08-29 [email protected] Check GTK calls are done on the same thread. (#174488) (flutter/flutter#174624)
2025-08-29 [email protected] [ Tool ] Only listen for DebugConnectionInfo if the service protocol is supported (flutter/flutter#174664)
2025-08-29 [email protected] Roll Dart SDK from 89023922f96d to 11f6cd99f6b3 (9 revisions) (flutter/flutter#174669)
2025-08-28 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[web] Refactor renderers to use the same frontend code (#174588)" (flutter/flutter#174672)
2025-08-28 [email protected] [a11y] [test] containsSemantics  can ignore SemanticsValidationResult (flutter/flutter#174608)
2025-08-28 [email protected] Fix some issues in engine-tool README. (flutter/flutter#174512)
2025-08-28 [email protected] Marks Linux_pixel_7pro new_gallery__transition_perf to be flaky (flutter/flutter#174106)
2025-08-28 [email protected] Make sure that an AlertDialog doesn't crash in 0x0 environment (flutter/flutter#174091)
2025-08-28 [email protected] Marks Linux_pixel_7pro hello_world_impeller to be flaky (flutter/flutter#173699)
2025-08-28 [email protected] Marks Linux_pixel_7pro drive_perf_debug_warning to be flaky (flutter/flutter#174112)
2025-08-28 [email protected] Marks Linux_android_emu android_display_cutout to be flaky (flutter/flutter#174501)
2025-08-28 [email protected] Marks Linux_pixel_7pro service_extensions_test to be flaky (flutter/flutter#174114)
2025-08-28 [email protected] Marks Windows plugin_test to be flaky (flutter/flutter#174117)
2025-08-28 [email protected] Marks Windows_mokey basic_material_app_win__compile to be flaky (flutter/flutter#173702)
2025-08-28 [email protected] Marks Mac_mokey microbenchmarks to be flaky (flutter/flutter#174102)
2025-08-28 [email protected] Marks Linux_mokey complex_layout__start_up to be flaky (flutter/flutter#173692)
2025-08-28 [email protected] Marks Linux build_android_host_app_with_module_aar to be flaky (flutter/flutter#172631)
2025-08-28 [email protected] Marks Linux_pixel_7pro new_gallery_opengles_impeller__transition_perf to be flaky (flutter/flutter#173338)
2025-08-28 [email protected] Marks Linux_pixel_7pro platform_views_scroll_perf_impeller__timeline_summary to be flaky (flutter/flutter#172211)
2025-08-28 [email protected] Remove the option to disable the merged platform/UI thread on Android and iOS (flutter/flutter#174408)
2025-08-28 [email protected] Don't fail when hot restarting `web-server` and there are no connected clients (flutter/flutter#174600)
2025-08-28 [email protected] Roll Skia from 7c2fe2629d4a to f3c8b4c677f5 (7 revisions) (flutter/flutter#174654)
2025-08-28 [email protected] [WebParagraph] More plumbing towards making it usable in Flutter apps (flutter/flutter#174587)
2025-08-28 [email protected] Roll Packages from 86fbeec to 141d8e3 (6 revisions) (flutter/flutter#174645)
2025-08-28 [email protected] [web] Refactor renderers to use the same frontend code (flutter/flutter#174588)
2025-08-28 [email protected] Roll Skia from eb000b138a9d to 7c2fe2629d4a (3 revisions) (flutter/flutter#174637)
2025-08-28 [email protected] [ Tool ] Roll package:dwds 25.0.4 (flutter/flutter#174601)
2025-08-28 [email protected] Roll Skia from 9b1642f2cfea to eb000b138a9d (2 revisions) (flutter/flutter#174627)
2025-08-28 [email protected] Roll Skia from 430d60054d66 to 9b1642f2cfea (7 revisions) (flutter/flutter#174625)
2025-08-28 [email protected] Refactored Canvas to disallow null inline contexts. (flutter/flutter#174530)
2025-08-28 [email protected] Revert "Check GTK calls are done on the same thread." (flutter/flutter#174604)
2025-08-27 [email protected] Roll Skia from 2a12b57fbbf0 to 430d60054d66 (3 revisions) (flutter/flutter#174590)
2025-08-27 [email protected] Retry "Implements the Android native stretch effect as a fragment shader (Impeller-only)." (flutter/flutter#173885)
2025-08-27 [email protected] Use raw `--removal-label "cp: ..."` when removing labels for unmerged PRs (flutter/flutter#174596)
2025-08-27 [email protected] Flutter driver deserialization (flutter/flutter#172927)
2025-08-27 [email protected] Check GTK calls are done on the same thread. (flutter/flutter#174488)
2025-08-27 [email protected] Fix broken reference to `PULL_REQUEST_CP_TEMPLATE.md` after refactor (flutter/flutter#174595)
...
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
Adds more descriptive ArgumentErrors to flutter driver deserialization
methods for commands and finders.

Also adds support for the normal defaults to the deserialization
handlers (can revert this if you like, but it helps when interacting
with flutter driver as a client so that it is more similar to how the
API works).

The tests aren't completely exhaustive as that would get very verbose,
but they do cover a variety of use cases.

Fixes flutter#172127

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
Adds more descriptive ArgumentErrors to flutter driver deserialization
methods for commands and finders.

Also adds support for the normal defaults to the deserialization
handlers (can revert this if you like, but it helps when interacting
with flutter driver as a client so that it is more similar to how the
API works).

The tests aren't completely exhaustive as that would get very verbose,
but they do cover a variety of use cases.

Fixes flutter#172127

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
Adds more descriptive ArgumentErrors to flutter driver deserialization
methods for commands and finders.

Also adds support for the normal defaults to the deserialization
handlers (can revert this if you like, but it helps when interacting
with flutter driver as a client so that it is more similar to how the
API works).

The tests aren't completely exhaustive as that would get very verbose,
but they do cover a variety of use cases.

Fixes flutter#172127

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
Adds more descriptive ArgumentErrors to flutter driver deserialization
methods for commands and finders.

Also adds support for the normal defaults to the deserialization
handlers (can revert this if you like, but it helps when interacting
with flutter driver as a client so that it is more similar to how the
API works).

The tests aren't completely exhaustive as that would get very verbose,
but they do cover a variety of use cases.

Fixes flutter#172127

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flutter driver should provide better error handling for malformed RPCs

3 participants