Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove problematic stream usage from FlutterView #162024

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gmackall
Copy link
Member

@gmackall gmackall commented Jan 22, 2025

Fixes #160945.

We should figure out why this stream usage is problematic. See the comment here #160945 (comment), that from what I can tell from Android docs it shouldn't be problematic. But it is causing crashes, and I think it is reasonable to change it so that it doesn't cause crashes, until we can figure out how to stop the crashes.

Pre-launch Checklist

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

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine repository. See also e: labels. labels Jan 22, 2025
@gmackall gmackall marked this pull request as ready for review January 22, 2025 20:09
@gmackall gmackall requested review from reidbaker and a team January 22, 2025 20:09
@gmackall
Copy link
Member Author

cc @matanlurey, as you were active on the original issue as well

@matanlurey
Copy link
Contributor

I personally would not make this change - streams have been in usage for a long time at this point, and there is nothing prohibiting us from introducing additional stream (or any de-sugared API), regressing the experience all over again. In other words, perhaps this fixes 1 particular problem for a subset of users, but it doesn't fix the underlying problem and perhaps even obfuscates it from us.

@gmackall
Copy link
Member Author

I personally would not make this change - streams have been in usage for a long time at this point, and there is nothing prohibiting us from introducing additional stream (or any de-sugared API), regressing the experience all over again. In other words, perhaps this fixes 1 particular problem for a subset of users, but it doesn't fix the underlying problem and perhaps even obfuscates it from us.

I agree it doesn't fix the larger problem, I'm also trying to do that separately. But we currently crash on a number of device/api levels that we claim to support, due to 1 trivial stream use. You don't think it's worth converting that to a different syntax while we attempt to solve the larger problem?

@matanlurey
Copy link
Contributor

matanlurey commented Jan 22, 2025

You don't think it's worth converting that to a different syntax while we attempt to solve the larger problem?

IMO, no, given the history.

We added this API in May 2022 (2ad3e5b), or approaching 3 calendar years from today. We have a serious problem if we can have a bug for 3 years, not detect it, and not know how to detect it, and I would put resources towards that instead of a particular crash (of which there might be more we just don't know about).

@matanlurey
Copy link
Contributor

In other words, solving this particular issue makes it no longer important to research further (and it goes to the bottom of the stack priority wise). If we are sure that won't happen (it almost always happens), then I'd say go for it with a TODO but you/Reid would know best and ultimately make the call.

@gmackall
Copy link
Member Author

We added this API in May 2022 (2ad3e5b), or approaching 3 calendar years from today. We have a serious problem if we can have a bug for 3 years, not detect it, and not know how to detect it, and I would put resources towards that instead of a particular crash (of which there might be more we just don't know about).

Agreed but also I think these require multiple different orders of magnitude of effort to solve, and aren't really substitutes for each other.

In other words, solving this particular issue makes it no longer important to research further (and it goes to the bottom of the stack priority wise). If we are sure that won't happen (it almost always happens), then I'd say go for it with a TODO but you/Reid would know best and ultimately make the call.

I agree this is a serious problem and should not drop to the bottom of the priority list just because 1 crash is fixed. The fact that it is serious is a large part of why I want to land a short term fix, though.

@reidbaker WDYT?

@reidbaker
Copy link
Contributor

@gmackall do you have a reproduction case that we have confirmed is fixed by this change? Or is this a best guess given the crash logs?

@gmackall
Copy link
Member Author

@gmackall do you have a reproduction case that we have confirmed is fixed by this change? Or is this a best guess given the crash logs?

This is a best guess, but also a pretty certain guess. I'm trying to reproduce the issue but have been unable. I may need to get my hands on a physical pixel 7 with Android 13

@reidbaker
Copy link
Contributor

@gmackall do you have a reproduction case that we have confirmed is fixed by this change? Or is this a best guess given the crash logs?

This is a best guess, but also a pretty certain guess. I'm trying to reproduce the issue but have been unable. I may need to get my hands on a physical pixel 7 with Android 13

Ok my thought is let this pr sit. Matan is correct that this usage is 3 years old which makes the fix less urgent. My worry is that the regression was not using this code but something else about our setup or tooling that happened more recently. If/when we get a reproduction case that will let us prove when the issue started.

We would land this change if we are not able to find a way to reproduce that way we are not dropping the priority of finding the root cause or how to protect against it.

In your attempts I would suggest creating an AAB then turning that into an apk. That is one of the differences between play store uploads and what we test.

@gmackall
Copy link
Member Author

gmackall commented Jan 23, 2025

My worry is that the regression was not using this code but something else about our setup or tooling that happened more recently. If/when we get a reproduction case that will let us prove when the issue started.

The reporter of #160945 is potentially experiencing it as a regression, but there are many others who have reported it further back (going back to 2023).
#141949
#148109

I am doubtful this is a new issue in 3.27

@reidbaker
Copy link
Contributor

@gmackall What it the plan with this pr?

@jesswrd
Copy link
Contributor

jesswrd commented Mar 11, 2025

from android triage: @johnmccutchan Would you rather land this without an investigation into the root cause or hold until the investigation is complete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine flutter/engine repository. See also e: labels. platform-android Android applications specifically
Projects
None yet
5 participants