Files
MoepchiandClaude Opus 5.5 f2d9115782 gateway: serialize write-then-rename per file
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
2026-11-28 00:23:20 +00:00
..