Repository navigation
Add structured warning event for slow wireless debugging on iOS 26+ devices - #176235
okorohelijah wants to merge 150 commits into
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. 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. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request introduces a helpful warning for developers using wireless debugging on iOS 26+ devices, which can have performance issues. The implementation correctly identifies the conditions and emits both a console warning and a structured event for IDEs. My feedback includes a suggestion to replace the magic number 26 with a named constant to improve code readability and maintainability.
DanTup
left a comment
There was a problem hiding this comment.
Added some minor comments/nits, but otherwise lgtm - thanks! 🙂
| This is sent when a warning is issued for a running application that an editor may wish to handle specifically. The `params` field will be a map with the following fields: | ||
|
|
||
| - `warning`: A string containing the warning message to be displayed to the user. | ||
| - `category`: A string used to categorize the warning (for example, `ios-wireless-performance`). |
There was a problem hiding this comment.
What might an editor do with this string?
I was thinking it might be useful for the editor to use if they want to show a "Don't warn me again" prompt and then store this as something to skip showing in future. However, for this I think a unique identifier per-message would be better (and the name category doesn't make it clear if this is unique).
There was a problem hiding this comment.
having an id for a specific warning which the IDE can ignore based on users' choice and category which could include different warningIds make sense!
| - `warning`: A string containing the warning message to be displayed to the user. | ||
| - `category`: A string used to categorize the warning (for example, `ios-wireless-performance`). | ||
| - `deviceId`: The ID of the device this warning is relevant to. | ||
| - `iosVersion`: The iOS versionn of the device |
There was a problem hiding this comment.
Although the current warning is for iOS, presumably in future we might use this for something else - so should we change this to something more generic (deviceOsVersion?) or just drop it? I'm not sure how useful it is to a client that's using this event generically.
(also nit: missing full stop at the end that the other points have)
There was a problem hiding this comment.
I think using deviceOsVersion is better than removing because it gives the IDE more flexibility to provide a structured data. and in a scenario where lets say the warning is more critical in some versions than some others, then the ide could maybe display a red icon instead of yellow to show severity
There was a problem hiding this comment.
in a scenario where lets say the warning is more critical in some versions than some others, then the ide could maybe display a red icon instead of yellow to show severity
I don't think the IDE should need to know about these versions though - if we want something to be higher priority, it should be encoded into the JSON so it can be handled generically (eg. a severity field).
I don't see any downside to having the OS version too though - if nothing else it could be useful when reviewing logs if this warning is being reported.
This PR improves the developer experience when running or debugging Flutter apps on iOS 26+ devices connected via WiFi. The tool now emits a structured
app.warningevent (in addition to a console warning) when it detects wireless debugging on iOS 26 or later. This allows IDEs and other tools using--machinemode to display a prominent warning to users, encouraging them to use a wired (USB) connection for better performance.Details
app.warningevent with relevant metadata (category, deviceId, iosVersion, suggestion, etc.) for IDEs and tools using--machinemode.List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.
Fixes #176206
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.