alibaba / alibaba/flutter_boost
[Bug]: Flutter 3.13.9 pushRoute 发送到reply需要200ms
- Dominant language
- Dart
- Stars
- 7.2k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
### 请描述遇到的问题,以及您所期望的正确的结果
Flutter 从3.3.9升级到3.13.9后,FlutterBoost.instance().getPlugin().onContainerAppeared 中执行的channel.pushRoute,从发送到reply回调需要近200ms,正常只需要几毫秒
2023-11-30 15:30:13.868 31462-31462/com.teamtalk.im D/FlutterBoost_java: #pushRoute start: workbench_double, ee728671-6a76-4df0-a29e-daf04f718a28_workbench_double, com.idlefish.flutterboost.FlutterBoostPlugin@9b40551
2023-11-30 15:30:14.059 31462-31462/com.teamtalk.im D/FlutterBoost_java: #pushRoute end: workbench_double, ee728671-6a76-4df0-a29e-daf04f718a28_workbench_double
### 请说明如何操作会遇到上述问题
多个FlutterBoostFragment,加载完后来回切换
### 在下面填入关键复现代码
FlutterBoostPlugin中pushRoute日志可验证
```
public void pushRoute(String uniqueId, String pageName, Map arguments,
final FlutterRouterApi.Reply callback) {
if (isDebugLoggingEnabled()) Log.d(TAG, "#pushRoute start: " + pageName + ", " + uniqueId + ", " + this);
if (channel != null) {
checkEngineState();
CommonParams params = new CommonParams();
params.setUniqueId(uniqueId);
params.setPageName(pageName);
params.setArguments(arguments);
channel.pushRoute(params, reply -> {
if (isDebugLoggingEnabled()) Log.d(TAG, "#pushRoute end: " + pageName + ", " + uniqueId);
if (callback != null) {
callback.reply(null);
}
});
} else {
throw new RuntimeException("FlutterBoostPlugin might *NOT* have attached to engine yet!");
}
}
```
### 复现的平台
Android
### Flutter SDK版本
3.13.9
### FlutterBoost版本
4.4.0
### 是否延迟初始化FlutterBoost
No
### 解决方案
Flutter 3.3.9没有该问题,3.7.0之后有该问题
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with FlutterBoostPlugin.pushRoute and the FlutterRouterApi channel call shown in the report. Reproduce the delay by switching between multiple FlutterBoostFragments on Android with Flutter 3.13.9, then compare it with Flutter 3.3.9. Done means identifying the regression and restoring the reply callback to its expected few-millisecond timing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, dart
- Domain
- mobile, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100