Skip to content

fix(sample): clear the Compose resource cache before the web demo loads - #778

Merged
hdcodedev merged 4 commits into
mainfrom
fix/web-demo-stale-resource-cache
Oct 12, 2026
Merged

hdcodedev merged 4 commits into
mainfrom
fix/web-demo-stale-resource-cache

Conversation

@hdcodedev

Copy link
Copy Markdown
Member

Summary

  • In WebKit browsers (Safari, DuckDuckGo, every iOS browser), the web demo could hang on the loader after a deploy until the page was refreshed.
  • Cause: Compose 1.12.1 clears compose_web_resources_cache on each page load but doesn't wait for it. In WebKit, resource loads read the old entries first, so returning visitors got the previous deploy's strings.commonMain.cvr. String decoding then threw IllegalArgumentException: The last unit of input does not have enough bits, and StartupGate never removed the loader.
  • index.html now clears that cache and waits before it adds the HDCharts.js script tag. The tag is appended as a <script src> because webpack derives its publicPath from the last script tag.
  • Adds a decision log row.

Local Validation

  • ./gradlew ktlintCheck
  • ./gradlew :charts-<module>:jvmTest
  • ./gradlew chartsTestJvm
  • ./gradlew ciCompile
  • ./gradlew chartsCheck
  • ./gradlew apiCompatibilityCheck
  • ../charts-playground/gradlew -p ../charts-playground -DchartsLocalPath="$PWD" ciCompile
  • ./gradlew :androidApp:validateDebugScreenshotTest
  • ./gradlew updateScreenshots

Also ran:

  • ./gradlew :app:wasmJsBrowserDistribution, before and after the fix.
  • A Playwright test against each local build on localhost: load once, plant a stale strings.commonMain.cvr in the cache, reload.
    • Before: WebKit stuck 5 of 5.
    • After: WebKit stuck 0 of 8, Chromium stuck 0 of 5.

@hdcodedev
hdcodedev merged commit ffd0651 into main Oct 12, 2026
22 checks passed
@hdcodedev
hdcodedev deleted the fix/web-demo-stale-resource-cache branch October 12, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant