You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Desktop: power loss during a connection-catalog save leaves a zero-filled file, the sidebar renders empty and all saved environments are lost #34076
The PC lost power while T3 Code was saving connection-catalog.json. After reboot the file was full of NUL bytes. From then on, every catalog read failed with a decode error and the sidebar showed no projects and no environments. The local state database was fine the whole time. Moving the corrupt file aside got the app working again, but every saved remote connection was lost. The catalog is encrypted with safeStorage and no backup is kept, so the connections had to be re-paired.
Environment
T3 Code Nightly 0.1.9-nightly.20261109.4443
Windows 10 Pro 22H2 (19045), NTFS
What happened
The last write to ~/.t3/userdata/connection-catalog.json was at 2026-11-09 23:50 local time.
On the morning of 2026-11-10 the machine lost power without a clean shutdown.
After reboot the file was 10,088 bytes, every byte 0x00. NTFS does this after a power loss during a write: the file size gets saved but the data blocks don't.
Every desktop:get-connection-catalog IPC call failed:
DesktopConnectionCatalogStoreDocumentDecodeError: Failed to decode the desktop connection catalog document at C:\Users\<user>\.t3\userdata\connection-catalog.json
(main.cjs:147484, 24 times in desktop.trace.ndjson)
The sidebar showed no projects and no environments, including local projects. statev2.sqlite was intact and its projects and threads were all there.
Workaround
Rename the corrupt file and reload. The read succeeds with an empty catalog, but every linked environment has to be paired again.
No fsync before the rename. The save writes a temporary file (write-temporary-file) and then renames it over the catalog (replace-catalog-file). Nothing flushes the temporary file to disk first. After a power cut, the rename can survive while the data doesn't, which leaves a zero-filled file in place of the catalog.
A decode failure is fatal. The error goes all the way up to the UI, which then renders nothing. A connection catalog it can't read also hides local projects that don't depend on it.
No last-known-good copy. The catalog is encrypted with safeStorage, so a corrupt file can't be repaired by hand and nothing is left to recover from.
Suggested fixes
fsync the temporary file before the rename, and fsync the parent directory after it where the platform supports that.
Keep the previous good catalog as connection-catalog.json.bak, and fall back to it when the main file won't decode.
If neither copy decodes: move the bad file aside (for example connection-catalog.json.corrupt-<timestamp>), start with an empty catalog, and tell the user their remote connections need re-pairing.
Show local projects whatever state the catalog is in.
Evidence available
The zeroed file and the trace log with the decode failures are kept. I can share the byte dump or the redacted log lines if they'd help.
Reproduced on Windows 11 (10.0.26340 x64), desktop app 0.1.12-nightly.20261123.5151, local Windows backend + WSL (fedora) backend enabled.
Trigger: a secondary disk (D:, where most project roots live) dropped out briefly. Windows logged disk 158: Disk 2 has the same disk identifiers as one or more disks connected to the system. The app was started while D: was missing.
Result:userdata/connection-catalog.json was 4668 bytes, all 0x00 (mtime unchanged from the previous day). On every launch the desktop logged desktop.connectionCatalogStore.get → DesktopConnectionCatalogStoreDocumentDecodeError; the sidebar showed "No projects yet" and Settings → Environments showed "0 machines", including no local environment. The server itself was healthy: statev2.sqlite had 22 projects and 707 live threads, and /.well-known/t3/environment answered normally.
Workaround: with the app closed, rename connection-catalog.json aside and relaunch. Local projects and threads come back; saved remote environments are lost.
Notes:
On this tag DesktopConnectionCatalogStore.ts writes to *.tmp and then renames, but there's no fsync of the file (or directory) before the rename, so NTFS can still surface a zero-filled file after an abrupt storage event.
A corrupt catalog also hides the local environment, which doesn't depend on catalog contents. Quarantining the bad file (e.g. .corrupt-<ts>) and falling back to an empty catalog plus the local env would turn this from "everything is gone" into "remote connections need re-pairing".
I hit this on Windows 11 x64 (build 26200) with T3 Code Nightly 0.1.14-nightly.20261127.5345.
I opened T3 Code and all my environments, projects, and threads were gone from the UI. My theme was still there. I couldn’t select a project for a new thread, and Ctrl+Alt+N didn’t open a thread without a project either.
connection-catalog.json was 4,172 bytes, all zeroes. The desktop trace logged DesktopConnectionCatalogStoreDocumentDecodeError on two launches. The local server responded, and statev2.sqlite still contained the projects and threads. Windows logged an unexpected restart shortly after the catalog’s last write. The exact cause of the corruption is unknown.
Fully quitting T3 Code, renaming connection-catalog.json to preserve it, and reopening the app restored my local workspace.
Diagnosed and drafted with OpenAI Codex (gpt6.2-sol).
Reproduced on the stable desktop build too, not only nightlies: Windows 10 Pro 22H2 (10.0.19045 x64), T3 Code desktop 0.1.13 (shows "up to date"), local backend plus one remote environment linked over T3 Connect.
Trigger: an unexpected Windows restart. The System log has Kernel-Power event 41 and EventLog 6008 ("the previous system shutdown at 17:43:08 was unexpected") on 2026-11-22. The catalog's mtime is 17:43:19, seconds after the crash.
Result
userdata/connection-catalog.json was 1,048 bytes, every byte 0x00.
Every launch since then logged in desktop.trace.ndjson (16 times in the current file, starting at desktop.startLocalBackend → desktop.ipc.installHandlers):
DesktopConnectionCatalogStoreDocumentDecodeError: Failed to decode the desktop connection catalog document at C:\Users\<user>\.t3\userdata\connection-catalog.json.
[cause]: SchemaError: Expected a valid JSON string
The UI was empty: no projects, no threads in the sidebar. Settings → Environments showed "This device — 0 of 0 connected" and "No saved remote environments", even with the "Local environment" toggle on.
statev2.sqlite was intact: 6 projects, 52 threads in orchestration_v2_projection_threads, and all project folders on disk. Restarting the app changed nothing.
The same remote environment kept working from the mobile app, which confirms the remote side was fine and only the desktop's local catalog was lost.
Workaround: close the app and rename connection-catalog.json (for example to connection-catalog.json.corrupt-<date>). On the next launch readCatalogDocument takes the NotFound branch and starts with an empty catalog. The T3 Connect remote then has to be re-added by hand.
This is the fourth independent Windows report of a zero-filled catalog after an unclean shutdown or disk event, now on a stable release. The two fixes proposed in the issue body would have prevented the data loss here and the empty UI: fsync before the rename, plus a .bak fallback, plus quarantining an undecodable file instead of failing.
Triaged with t3 triage (CLI 0.1.13) by Claude Opus 5.5 in Claude Code.
Activity
tears-mysthrala commentedon Nov 23, 2026
Reproduced on Windows 11 (10.0.26340 x64), desktop app
0.1.12-nightly.20261123.5151, local Windows backend + WSL (fedora) backend enabled.Trigger: a secondary disk (
D:, where most project roots live) dropped out briefly. Windows loggeddisk 158: Disk 2 has the same disk identifiers as one or more disks connected to the system. The app was started whileD:was missing.Result:
userdata/connection-catalog.jsonwas 4668 bytes, all0x00(mtime unchanged from the previous day). On every launch the desktop loggeddesktop.connectionCatalogStore.get → DesktopConnectionCatalogStoreDocumentDecodeError; the sidebar showed "No projects yet" and Settings → Environments showed "0 machines", including no local environment. The server itself was healthy:statev2.sqlitehad 22 projects and 707 live threads, and/.well-known/t3/environmentanswered normally.Workaround: with the app closed, rename
connection-catalog.jsonaside and relaunch. Local projects and threads come back; saved remote environments are lost.Notes:
DesktopConnectionCatalogStore.tswrites to*.tmpand thenrenames, but there's no fsync of the file (or directory) before the rename, so NTFS can still surface a zero-filled file after an abrupt storage event..corrupt-<ts>) and falling back to an empty catalog plus the local env would turn this from "everything is gone" into "remote connections need re-pairing".Filed via
t3 triageby Claude Code (Opus 5.5).SagumAnuts commentedon Nov 27, 2026
I hit this on Windows 11 x64 (build 26200) with T3 Code Nightly
0.1.14-nightly.20261127.5345.I opened T3 Code and all my environments, projects, and threads were gone from the UI. My theme was still there. I couldn’t select a project for a new thread, and
Ctrl+Alt+Ndidn’t open a thread without a project either.connection-catalog.jsonwas 4,172 bytes, all zeroes. The desktop trace loggedDesktopConnectionCatalogStoreDocumentDecodeErroron two launches. The local server responded, andstatev2.sqlitestill contained the projects and threads. Windows logged an unexpected restart shortly after the catalog’s last write. The exact cause of the corruption is unknown.Fully quitting T3 Code, renaming
connection-catalog.jsonto preserve it, and reopening the app restored my local workspace.Diagnosed and drafted with OpenAI Codex (gpt6.2-sol).
Juanestebane926 commentedon Dec 2, 2026
Reproduced on the stable desktop build too, not only nightlies: Windows 10 Pro 22H2 (10.0.19045 x64), T3 Code desktop
0.1.13(shows "up to date"), local backend plus one remote environment linked over T3 Connect.Trigger: an unexpected Windows restart. The System log has Kernel-Power event 41 and EventLog 6008 ("the previous system shutdown at 17:43:08 was unexpected") on 2026-11-22. The catalog's mtime is 17:43:19, seconds after the crash.
Result
userdata/connection-catalog.jsonwas 1,048 bytes, every byte0x00.desktop.trace.ndjson(16 times in the current file, starting atdesktop.startLocalBackend→desktop.ipc.installHandlers):statev2.sqlitewas intact: 6 projects, 52 threads inorchestration_v2_projection_threads, and all project folders on disk. Restarting the app changed nothing.Workaround: close the app and rename
connection-catalog.json(for example toconnection-catalog.json.corrupt-<date>). On the next launchreadCatalogDocumenttakes theNotFoundbranch and starts with an empty catalog. The T3 Connect remote then has to be re-added by hand.This is the fourth independent Windows report of a zero-filled catalog after an unclean shutdown or disk event, now on a stable release. The two fixes proposed in the issue body would have prevented the data loss here and the empty UI: fsync before the rename, plus a
.bakfallback, plus quarantining an undecodable file instead of failing.Triaged with
t3 triage(CLI 0.1.13) by Claude Opus 5.5 in Claude Code.