diff --git a/CHANGELOG.md b/CHANGELOG.md index a3684f8..7b24900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2026-05-07 23:05 CEST — fix(go): default CacheDir to `tmp/go` to avoid Python collision + +- `go/internal/config/config.go`: `CacheDir` default changed from `tmp` to `tmp/go`. Override via `CACHE_DIR` env var still works. +- Why: both backends used `tmp/_cache.json` with the same keys (`attendance_regular`, `attendance_juniors`, `payments_transactions`, `exceptions_dict`) but different shapes — Python caches post-processed view-model tuples, Go caches raw rows. Whichever wrote last poisoned the cache; running both in parallel produced `ValueError: too many values to unpack (expected 2, got 68)` on Python's `/adults` after the Go server populated `attendance_regular_cache.json` with raw CSV rows. +- After upgrading: stop the Go server, hit `/flush-cache` on the Python side once (rewrites `tmp/*.json` with correct shapes), then restart `make web-go` — it will use `tmp/go/` going forward. Required for the M5.4 `make parity` workflow which assumes both backends run side-by-side. + ## 2026-05-07 22:37 CEST — feat(py): M5.3 — Python /api/* shadow endpoints - `app.py`: four new JSON routes (`/api/version`, `/api/adults`, `/api/juniors`, `/api/payments`) mirroring the Go `/api/*` handlers; `_unwrap_view_model_for_api()` helper expands pre-serialised JSON strings and renames `month_labels_json` → `month_labels`, `raw_payments_json` → `raw_payments` to match Go wire contract. diff --git a/go/internal/config/config.go b/go/internal/config/config.go index 40815ca..b9d5a11 100644 --- a/go/internal/config/config.go +++ b/go/internal/config/config.go @@ -50,7 +50,7 @@ func Load() Config { return Config{ CredentialsPath: env("CREDENTIALS_PATH", ".secret/fuj-management-bot-credentials.json"), BankAccount: env("BANK_ACCOUNT", "CZ8520100000002800359168"), - CacheDir: env("CACHE_DIR", "tmp"), + CacheDir: env("CACHE_DIR", "tmp/go"), CacheTTL: envDuration("CACHE_TTL_SECONDS", 300), CacheAPICheckTTL: envDuration("CACHE_API_CHECK_TTL_SECONDS", 300), DriveTimeout: envDuration("DRIVE_TIMEOUT_SECONDS", 10),