fluttercommunity / fluttercommunity/flutter_webview_plugin
getCookies throws a RangeError if there are no cookies
- 主要言語
- Java
- スター
- 1.5k
- フォーク
- 938
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
## System info
Issue occurs on: Android for sure, haven't tested iOS
Plugin version: 0.3.7
Flutter doctor output:
```
[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows [Version 10.0.17763.678], locale de-AT)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[√] Android Studio (version 3.4)
[√] Connected device (3 available)
• No issues found!
```
## Steps to Reproduce
1. Call `FlutterWebviewPlugin.getCookies` when there are no cookies, e.g. directly after calling `FlutterWebviewPlugin.cleanCookies`.
2. Note: Debugging shows that the variable `cookiesString` in the `getCookies` method has the value `\"\"` when the error is thrown.
## Logs
```
E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: RangeError (index): Invalid value: Only valid value is 0: 1
#0 List.[] (dart:core-patch/growable_array.dart:145:60)
#1 FlutterWebviewPlugin.getCookies. (package:flutter_webview_plugin/src/base.dart:238:34)
#2 List.forEach (dart:core-patch/growable_array.dart:278:8)
#3 FlutterWebviewPlugin.getCookies (package:flutter_webview_plugin/src/base.dart:236:32)
#4 _SettingsScreenState._getCookieCount (package:my_app/screens/settings_screen.dart:37:43)
[rest is not relevant]
```
```
No issues found! (ran in 2.7s)
```
```
[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows [Version 10.0.17763.678], locale de-AT)
• Flutter version 1.7.8+hotfix.4 at C:\Android\flutter
• Framework revision 20e59316b8 (4 weeks ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at C:\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• ANDROID_HOME = C:\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[√] Android Studio (version 3.4)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 38.2.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
package:flutter_webview_plugin/src/base.dart の FlutterWebviewPlugin.getCookies(236-238 行目付近)から始め、cleanCookies を呼び出した後のケースを再現してください。空の cookies レスポンスによって RangeError が発生しなくなっていること、および getCookies が cookies がないケースを正しく処理することを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, dart
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100