mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-05 06:29:44 +08:00
A users.json that exists but cannot be read as a JSON object was treated as an empty store, so the next write replaced every account with a single record promoted to admin, and is_first_user() reopened /register for anyone. Separate "no store yet" from "store is unusable": an absent, zero-byte, whitespace-only, byte-order-mark-only, null, [] or JSON-scalar document holds no accounts and still bootstraps; invalid JSON and a non-empty array are reported. load_users() reports the problem once a minute per path, and the single write funnel refuses to replace the operator's bytes, raising AccessError(503) for an unreadable store and for a write the volume rejects, including a first boot on an unwritable volume. The caller-facing detail names the bare file and the remedy; the parse failure and the absolute path stay in the operator log, because OS error text embeds the path in a repr-escaped form that cannot be redacted reliably.