Skip to content

Commit 8615d7e

Browse files
author
Claude
committed
fix: invalidate WebView cache if it contains stale deno.dev proxy URL
1 parent ca01909 commit 8615d7e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

app/src/main/kotlin/com/google/ai/sample/MainActivity.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,12 @@ class MainActivity : ComponentActivity() {
639639
val f = webViewCacheFile
640640
if (f.exists() && f.length() > 0) {
641641
val content = f.readText(Charsets.UTF_8)
642+
// Invalidate cache if it still contains the old dead proxy URL.
643+
if (content.contains("screenoperator-kilo-proxy.deno.dev")) {
644+
Log.w(TAG, "readWebViewCache: Cache contains stale proxy URL (deno.dev) – discarding cache to force fresh load.")
645+
f.delete()
646+
return null
647+
}
642648
Log.d(TAG, "readWebViewCache: Loaded cached HTML ({} Zeichen).".format(content.length))
643649
content
644650
} else {

0 commit comments

Comments
 (0)