mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Every JSON store (ping, store, news, sync, admin auth, config) wrote to one shared "<file>.tmp" and renamed it. Parallel requests raced on that path: one rename won, the others failed with ENOENT, and overlapping writes could leave a mangled file that reads as empty after a restart. Seen live from a parallel /api/ping probe. writeFileAtomic() in net.ts queues writes per file, so the last caller's data always lands last. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU