# fix\(server\): make durable writes survive Windows fsync rules · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/4c642ebd4f8cd9ef61e2fc03210ea536506be7ac)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 4c642ebd4f8cd9ef61e2fc03210ea536506be7ac

Requested commit: 4c642ebd4f8cd9ef61e2fc03210ea536506be7ac

Commit: 4c642ebd4f8cd9ef61e2fc03210ea536506be7ac

Tree: 2386fa3defcbc74d8c3a1d571cc30a0c68e23951

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): make durable writes survive Windows fsync rules

writeServiceState, the database backup, and the boot-service installer
fsync what they wrote and then the parent directory so an atomic rename
survives power loss. Windows breaks both halves: a handle opened read-only
cannot be flushed, and a directory handle opens but fails to sync with
EPERM. Every service-state write and every trial update therefore failed
there. Open the file read-write before syncing it and ignore EPERM on the
directory sync, which NTFS journals on its own.

Co-Authored-By: Claude Code <noreply@anthropic.com>

```

## Parents

- [391e4ab11c45bb489167ff67c8cd092333812f9c](https://git.cafe/pingdotgg/t3code/commit/391e4ab11c45bb489167ff67c8cd092333812f9c?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/4c642ebd4f8cd9ef61e2fc03210ea536506be7ac?format=markdown)
