From 81d8e55fb0024a97bbde437eaba43e5feb61eeb1 Mon Sep 17 00:00:00 2001 From: giles Date: Sat, 7 Mar 2026 22:38:49 +0000 Subject: [PATCH] Fix sx-browser.js cache bust: use correct path for hash computation _script_hash used relative Path("static") which resolved to /app/static/ inside the container, but the file is at /app/shared/static/. Use Path(__file__).parent.parent to resolve from shared/ correctly. Co-Authored-By: Claude Opus 4.6 --- shared/sx/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/sx/helpers.py b/shared/sx/helpers.py index 251f5a4..773b223 100644 --- a/shared/sx/helpers.py +++ b/shared/sx/helpers.py @@ -1047,7 +1047,7 @@ def _script_hash(filename: str) -> str: """Compute MD5 hash of a static script file, cached for process lifetime.""" if filename not in _SCRIPT_HASH_CACHE: try: - data = (Path("static") / "scripts" / filename).read_bytes() + data = (Path(__file__).resolve().parent.parent / "static" / "scripts" / filename).read_bytes() _SCRIPT_HASH_CACHE[filename] = hashlib.md5(data).hexdigest()[:8] except OSError: _SCRIPT_HASH_CACHE[filename] = "dev"