fluttercommunity / fluttercommunity/flutter_webview_plugin

Weird lag while navigating to WebviewScaffold

Đang mở
#604 5 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
1.5k
Fork
938
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## System info

Issue occurs on: both
Plugin version: 0.3.9+1
Flutter doctor output:

```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale en-EG)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.0)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.4)
[✓] VS Code (version 1.38.1)
[✓] Connected device (1 available)

• No issues found!
```

## Steps to Reproduce

I'm facing a weird lag while navigating to WebviewScaffold. It's as if the body is being drawn without animation in the final location while still animating the app bar. It happens in both iOS & Android but it's more visible in iOS due to the default animation. I'm attaching gifs to show the issue

![laginnavigation](https://user-images.githubusercontent.com/25547179/69162730-c6fdab80-0af5-11ea-9421-eb4daff6f5f1.gif)

![lagandroid](https://user-images.githubusercontent.com/25547179/69163408-d03b4800-0af6-11ea-8818-a4c028a4c8e0.gif)

Here is the code to reproduce it

```
void _openWebView({@required String title, @required String url})
{
widget._logger.log(message: url);
Navigator.of(context).push(MaterialPageRoute
(
builder: (context)
{
return WebviewScaffold
(
url: url,
withJavascript: true,
clearCache: true,
clearCookies: true,
withZoom: false,
appBar: TopNavBar.getAppBar(context, title, BackButton(color: Configs.current.COLORS_PRIMARY)),
initialChild: Container
(
width: MediaQuery.of(context).size.width,
color: Colors.white,
child: Center
(
child: Loader
(
shadow: Colors.transparent,
hasText: false,
),
),
),
);
}
));
}
```

## Logs

```
[+2061 ms] [DEVICE LOG] 2019-11-19 19:32:08.872626+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x7fbf0a43b260 - ProcessThrottler::didConnectToProcess(41542)
[ ] [DEVICE LOG] 2019-11-19 19:32:08.872738+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f72d0 - ProcessAssertion() PID 41473 acquiring assertion for process with PID 41542, name 'Web
content visibility'
[ ] [DEVICE LOG] 2019-11-19 19:32:08.872996+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x60000377a300 - WKProcessAssertionBackgroundTaskManager - beginBackgroundTaskWithName
[ +13 ms] [DEVICE LOG] 2019-11-19 19:32:08.887510+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2d0228 - ProcessThrottler::didConnectToProcess(41543)
[ ] [DEVICE LOG] 2019-11-19 19:32:08.887566+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7300 - ProcessAssertion() PID 41473 acquiring assertion for process with PID 41543, name 'Web
content visibility'
[ ] [DEVICE LOG] 2019-11-19 19:32:08.887638+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2d0000 - WebProcessProxy::didSetAssertionState(Foreground) taking foreground assertion for network
process
[ ] [DEVICE LOG] 2019-11-19 19:32:08.887746+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x7fbf0a689bc0 - ProcessThrottler::didConnectToProcess(41544)
[ ] [DEVICE LOG] 2019-11-19 19:32:08.887781+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7330 - ProcessAssertion() PID 41473 acquiring assertion for process with PID 41544, name 'Web
content visibility'
[ +249 ms] [DEVICE LOG] 2019-11-19 19:32:09.139014+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7360 - ProcessAssertion() PID 41473 acquiring assertion for process with PID 41542, name
'ConnectionTerminationWatchdog'
[ ] [DEVICE LOG] 2019-11-19 19:32:09.139257+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f72d0 - ~ProcessAssertion() Releasing process assertion
[ ] [DEVICE LOG] 2019-11-19 19:32:09.140266+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x7fbf0a43b130 - NetworkProcessProxy is releasing a background assertion because the Network process is
done deleting Website data
[ +472 ms] [DEVICE LOG] 2019-11-19 19:32:09.612788+0200 localhost Runner[41473]: (RunningBoardServices) Created Activity ID: 0x9a1cac, Description: assertionsDidInvalidate
[ ] [DEVICE LOG] 2019-11-19 19:32:09.613477+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7360 - ProcessAssertion() Process assertion for process with PID 41542 was invalidated
[ ] [DEVICE LOG] 2019-11-19 19:32:09.613559+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2f7360 - ProcessAssertion::processAssertionWasInvalidated()
[ +7 ms] [DEVICE LOG] 2019-11-19 19:32:09.620989+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:Process] Created visibility propagation view 0x7fbf0a683c90 for WebContent process with PID 41543
[ +22 ms] [DEVICE LOG] 2019-11-19 19:32:09.643655+0200 localhost Runner[41473]: (CoreFoundation) Created Activity ID: 0x9a1cad, Description: Loading Preferences From System CFPrefsD
[ +1 ms] [DEVICE LOG] 2019-11-19 19:32:09.644600+0200 localhost Runner[41473]: (AppSSOCore) [com.apple.AppSSO:SOConfigurationClient] -[SOConfigurationClient init] on
[ ] [DEVICE LOG] 2019-11-19 19:32:09.644808+0200 localhost Runner[41473]: (AppSSOCore) [com.apple.AppSSO:SOServiceConnection] : new XPC connection
[ +2 ms] [DEVICE LOG] 2019-11-19 19:32:09.648162+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x7fbf0b199020 - WebPageProxy::decidePolicyForNavigationAction: keep using process 41543 for navigation,
reason: Process has not yet committed any provisional loads
[ +7 ms] [DEVICE LOG] 2019-11-19 19:32:09.655784+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didStartProvisionalLoadForFrame: webPID = 41543, pageID = 8, frameID = 1
[ +85 ms] [DEVICE LOG] 2019-11-19 19:32:09.741085+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] UIProcess is taking a background assertion because the WebContent process is holding locked files
[ +76 ms] [DEVICE LOG] 2019-11-19 19:32:09.816186+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didNavigateWithNavigationDataShared: webPID = 41543, pageID = 8
[ ] [DEVICE LOG] 2019-11-19 19:32:09.816452+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didCommitLoadForFrame: webPID = 41543, pageID = 8, frameID = 1
[ +139 ms] [DEVICE LOG] 2019-11-19 19:32:09.957310+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didFinishDocumentLoadForFrame: webPID = 41543, pageID = 8, frameID = 1
[ +21 ms] [DEVICE LOG] 2019-11-19 19:32:09.978038+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:Loading] 0x7fbf0b199020 - WebPageProxy::didFinishLoadForFrame: webPID = 41543, pageID = 8, frameID = 1
[ ] [DEVICE LOG] 2019-11-19 19:32:09.978097+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2e94e0 - NavigationState will release its process network assertion soon because the page load
completed
[+3002 ms] [DEVICE LOG] 2019-11-19 19:32:12.979149+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x13f2e94e0 NavigationState is releasing background process assertion because a page load completed
[+1760 ms] [DEVICE LOG] 2019-11-19 19:32:14.741773+0200 localhost Runner[41473]: (WebKit) [com.apple.WebKit:ProcessSuspension] UIProcess is releasing a background assertion because the WebContent process is no longer holding
locked files

```

```
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale en-EG)
• Flutter version 1.9.1+hotfix.6 at /Users/osamafelfel/work/flutter
• Framework revision 68587a0916 (10 weeks ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200c37
• Dart version 2.5.0


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/osamafelfel/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.2.1, Build version 11B500
• CocoaPods version 1.7.5

[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 23.2.1
• Dart plugin version 171.4424
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.4)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 41.1.4
• Dart plugin version 192.7402

[✓] VS Code (version 1.38.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.2.0

[✓] Connected device (2 available)
• AOSP on IA Emulator • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• iPhone 11 Pro Max • 1CCE1C63-DFC2-46B6-90B3-40AA32573E54 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-2 (simulator)

• No issues found!
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Tái hiện độ trễ bằng ví dụ _openWebView được cung cấp và WebviewScaffold trên cả iOS và Android, đồng thời so sánh hiệu ứng hoạt ảnh điều hướng với các bản ghi đính kèm. Điều tra hoạt động điều hướng và kết xuất ban đầu của WebviewScaffold trong plugin; hoàn thành khi body và app bar hoạt ảnh cùng nhau mà không có độ trễ đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Lĩnh vực
mobile-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
32/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.