-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix iOS text selection crash by returning nil range #55909
Fix iOS text selection crash by returning nil range #55909
Conversation
cc @justinmc |
@chinmaygarde Thanks for that bump. Is there a chance at getting this in the review queue soon? This assertion is one of our most common crashes. Simply deselecting the text on some touches (this PR) is preferable to tossing the whole app session out. If there's desire to fix the upstream range finding, that makes sense, but we'd love to save that for focused follow-on where there's a test battery. |
@hellohuanlin can you take a look? My concern is that this regresses #16496 and b/149077991, in which case we need a different solution. |
Honest question: is a regression possible? Sessions that currently crash will simply now continue, allowing VO/non-VO users to retry input strategies. #16496 stopped a crash when using VoiceOver in a provided sample app. That sample does not crash now. Thanks for analyzing this and getting it in the queue! |
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.
Honest question: is a regression possible?
Should be safe since it's removing NSAssert
@hellohuanlin NSAsserts are on in release mode in Flutter flutter/flutter#157837 (cbracken mentioned he wanted to fix that) |
shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm
Outdated
Show resolved
Hide resolved
Any progress with this one? Customers aren't very happy with crashes |
275c59f
to
a3d596a
Compare
CI failure is only on mac_android_aot_engine. I don't get a retry option, so I'll push a commit to trigger again. |
shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm
Outdated
Show resolved
Hide resolved
Who else would need to approve? Like @gvozditskiy, we'd love to get this crash silenced. |
We just need one more approval thanks. @chunhtai @LongCatIsLooong @cbracken |
auto label is removed for flutter/engine/55909, Failed to merge flutter/engine/55909 with Pull request flutter/engine/55909 could not be merged: You're not authorized to push to this branch. Visit https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches for more information.. |
Ah of course, this change needs to be recreated in https://github.com/flutter/flutter/tree/master/engine post-monorepo (this entire repository was moved to that subdirectory). You can check out https://github.com/flutter/flutter/ and then I am also happy to do this, but you'll lose the authorship. |
Monorepo Migration Completed
The
This is a canned message |
[Previously approved](flutter/engine#55909) in /engine before monorepo shift. Reverts an unnecessary assertion introduced by [#16496](flutter/engine#16496) that crashes upon valid user text field interactions. Follow-on work can resolve the underlying discrepancy between iOS and Flutter range finding (see #160100). For crash reports, see issue [#138464](#138464). ## 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. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md Co-authored-by: Chris Bracken <[email protected]>
Reverts a runtime crashing assertion introduced by #16496. Defensively favors returning a nil text selection range rather than crash. See issue #138464 for crash reports and reproduction recordings.
Without this revert, to avoid a crash hit in a minority of user interactions with a text field, we must degrade experiences for all users by disabling useful iOS text field behaviors (see #138464 for workarounds).
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Fix iOS text selection crash by returning nil range