I use the Antigravity desktop app 2.26.0 on Windows 11. While checking why a setting I had changed was not taking effect, I looked at how the app saves its settings, and found a race that can lose settings or reset all of them.
The app keeps its settings in %APPDATA%\Antigravity\app_storage.json. On my machine that file is 100 KB with 190 keys. Besides settings such as autoCheckForUpdates, keepComputerAwake and runInBackground, it holds my comments (54 KB) and the layout of every conversation I have opened (172 keys, never cleaned up).
How the app writes it, from the app’s own dist/storage.js in resources\app.asar:
- Every change reads the whole file, edits it in memory, and writes the whole file back in place.
- Nothing orders two changes that happen at the same time, and the write is not done through a temporary file and a rename.
- Changing the zoom with Ctrl and the mouse wheel starts one such write per wheel tick, without waiting for the previous one. The UI saves its own state through the same path.
I measured it two ways.
- While an agent was working, the app rewrote this 100 KB file 5 times in 90 seconds.
- I ran the app’s own read-edit-write logic against a test copy of the file, with 8 zoom changes and 1 UI change arriving together, 50 times:
| Result | Trials |
|---|---|
| At least one change lost | 50 of 50 |
| File left as invalid JSON | 19 of 50 |
My paused-updates setting (autoCheckForUpdates: false) gone |
21 of 50 |
The invalid JSON happens when a shorter write lands over a longer one and leaves the old tail behind. When the app next reads an invalid file, it treats it as empty, so every setting silently returns to its default. A crash or power loss in the middle of a write would do the same.
What I’d expect:
- Write changes one at a time, in order.
- Write to a temporary file and rename it over the old one, so the file is always either the old version or the new one.
- Keep a copy in memory, so a zoom change does not reread 100 KB from disk.
- Keep UI layout and comments apart from settings, and remove layout entries for conversations that no longer exist.
I have not seen my settings reset in normal use that I could tie to this. But I did change autoCheckForUpdates on purpose, and that is exactly the kind of setting this race can silently undo.