[webview_flutter_android] Clear local storage when clearCache is called#5086
[webview_flutter_android] Clear local storage when clearCache is called#5086bparrishMines merged 13 commits intoflutter:mainfrom
clearCache is called#5086Conversation
clearCache is called
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Wow, this definitely demonstrates the downside to directly wrapping an API with a constellation of objects. I guess the mitigation here is that adding a whole new object wrapper will become very rare over time.
...r_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebStorageHostApiImpl.java
Show resolved
Hide resolved
|
|
||
| * Fixes bug preventing `mockito` code generation for tests. | ||
| * Fixes regression where local storage wasn't cleared when `WebViewController.clearCache` was | ||
| called. |
There was a problem hiding this comment.
Could you add a new integration test for this case? It seems like a very good candidate for integration testing since the high-level behavior is easily expressible in a user-visible way, so should be easy to do an integration test for.
It would also be good to add to the app-facing package, since the original mistake here demonstrates that an implementor could easily miss part of the intended behavior here.
There was a problem hiding this comment.
Done. I added it to the app-facing package as well, but it is skipped for Android. I also added a TODO to remove the skip once a new version is published.
stuartmorgan-g
left a comment
There was a problem hiding this comment.
LGTM, thanks for the test!
(I believe the federated safety check will fail on this now, but it's safe to override with the PR message in this case.)
Fixes regression where local storage wasn't cleared when
WebViewController.clearCachewas called:Original Code: 8f55fb6#diff-60861265259b6695609221b1bb21919e63a6357ac8d04fdf9fef1b4e4b045e82L371
No version change: This only adds an integration test to
webview_flutter.No CHANGELOG change: This only adds an integration test to
webview_flutter.Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.