From 54463baf0ea8d27dcef1f6be18f42346d06014f8 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Sun, 5 Jul 2026 04:11:12 -0700 Subject: [PATCH] fix: fsync parent dir after direct-write fallback for durability parity --- app/state_store.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/state_store.py b/app/state_store.py index 57ead6c..940a882 100644 --- a/app/state_store.py +++ b/app/state_store.py @@ -169,6 +169,8 @@ class AtomicJsonStore: f.write(text) f.flush() self._best_effort_fsync(f.fileno()) + # Make the new directory entry durable too, matching the atomic path. + self._fsync_directory(os.path.dirname(self.path) or ".") @staticmethod def _best_effort_fsync(fileno: int) -> None: