Self-heal a stale cached bundle via a build version

Phones kept running old JS because their cached index.html pointed at an old
hashed asset. Both images now bake the commit SHA as BUILD_VERSION; the backend
exposes it at GET /api/version and the client reloads once with a cache-busting
query when its own baked version differs. Guarded by sessionStorage so it cannot
loop. /api/version is unauthenticated like /api/health.
This commit is contained in:
matitos committed 2026-09-21 00:16:43 +00:00
1 parent 7ad14449ce
commit 7b97f010c9
11 files changed
+80 -4

No files matched your search

+2
View File
@@ -133,6 +133,8 @@ jobs:
# Persistent data root: repo var wins, else derive from the org
# PERSISTENT_MOUNT (absolute HOST path), else the workspace fallback.
CRYPTO_DATA_DIR: ${{ vars.CRYPTO_DATA_DIR || (vars.PERSISTENT_MOUNT && format('{0}/crypto_trading', vars.PERSISTENT_MOUNT)) || './data' }}
# Stamped into both images so the client can detect a stale cached bundle.
CRYPTO_BUILD_VERSION: ${{ github.sha }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
steps: