Add Clear Caches menu item to login view - #2752
Conversation
wmathurin
commented
Aug 29, 2025
- Add sf__clear_caches string resource
- Implement clearCaches method using webView.clearCache(true)
- Add Clear Caches menu item to login dropdown
- Add unit and UI tests for new functionality
- Add sf__clear_caches string resource - Implement clearCaches method using webView.clearCache(true) - Add Clear Caches menu item to login dropdown - Add unit and UI tests for new functionality
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (29.41%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #2752 +/- ##
============================================
- Coverage 56.11% 56.05% -0.07%
+ Complexity 2488 2486 -2
============================================
Files 211 211
Lines 17239 17256 +17
Branches 2408 2408
============================================
- Hits 9673 9672 -1
- Misses 6518 6535 +17
- Partials 1048 1049 +1
🚀 New features to boost your workflow:
|
| /** Clear WebView Caches. */ | ||
| open fun clearCaches(webView: android.webkit.WebView) { | ||
| webView.clearCache(true) | ||
| } |
There was a problem hiding this comment.
Do we want to also reload after clearing cache? I believe we do that when we clear cookies.
Should be noted that reloading will cycle the web server code verifier but I don't think that will matter.
There was a problem hiding this comment.
The caller does the reload, see https://github.com/forcedotcom/SalesforceMobileSDK-Android/pull/2752/files#diff-321c03965ac0663f16817520073fbe2d6def698c5568ab388f1161c35536d069R303
NB: it's the same with clearCookies.
open fun clearCookies() =
CookieManager.getInstance().removeAllCookies(null)There was a problem hiding this comment.
Whoops, I missed that. Great!
Renaming methods accordingly Fixed test