# \[Bug\]: macOS Nightly fails to decrypt connection-catalog.json on startup \(revert 41b513d99a regression\), blocking all chats and connections · Issue \#23917 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/issues/23917)

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

Visibility: public

State: backlog

Priority: 0

## Description

[Discussion and activity](https://git.cafe/pingdotgg/t3code/issues/23917)

---

### Before submitting

- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.

### Area

apps/desktop

### Steps to reproduce

1. Have an existing macOS T3 Code (Nightly) installation with saved connections in `~/.t3/userdata/connection-catalog.json` (encrypted using the `T3 Code (Nightly) Safe Storage` macOS Keychain identity).
2. Update to Nightly version `0.1.3-nightly.20261023.3553` (which includes commit `41b513d99a`).
3. Launch T3 Code (Nightly).

### Expected behavior

The app boots up, decrypts `connection-catalog.json`, connects to the local and remote environments, and displays all existing chat threads and connections.

### Actual behavior

- `DesktopConnectionCatalogStore.get` throws `DesktopConnectionCatalogStoreProtectionError` during `decrypt-catalog`.
- The IPC method `desktop:get-connection-catalog` fails with an unhandled defect.
- In the renderer, `makeCatalogStore` in `apps/web/src/connection/storage.ts` crashes, taking down `ConnectionTargetStore`.
- The UI fails to connect to the local backend environment (`EnvironmentRpc.request`), leaving the app showing **0 connections, 0 models, and 0 chat threads** (giving the false appearance that all user data was wiped).

### Impact

Blocks work completely

### Version or commit

`0.1.3-nightly.20261023.3553` (Commit `51273020db32` / `d36b7da248`), regression caused by commit `41b513d99a` (`revert: "fix(desktop): saved connections survive the Beta rename on macOS and Linux" (#20907) (#22219)`).

### Environment

macOS 26 (Apple Silicon arm64), T3 Code (Nightly) `0.1.3-nightly.20261023.3553`.

### Root Cause Analysis

In commit `41b513d99a`, PR #20907 was reverted. This removed:
```typescript
if (platform === "darwin" || platform === "linux") {
  Electron.app.setName(resolveDesktopSafeStorageName(Electron.app.getVersion()));
}
```
from `apps/desktop/src/app/DesktopPreReadyElectronOptions.ts`.

On macOS, Chromium's OSCrypt (which powers Electron's `safeStorage`) queries and caches the Keychain service name from `app.getName()` before the startup event loop yields. `DesktopAppIdentity.configure` setting the name later only changes the branded JavaScript name, not Chromium's internal OSCrypt service name.

Without the pre-ready call, Chromium defaults to package name `t3code`, querying macOS Keychain for `t3code Safe Storage` / `t3code Key`. Because existing Nightly catalogs were encrypted with `T3 Code (Nightly) Safe Storage` / `T3 Code (Nightly) Key`, decryption fails with:
`Error: Error while decrypting the ciphertext provided to safeStorage.decryptString.`

Additionally, `DesktopConnectionCatalogStore.ts` treats decryption failure as an unrecoverable fatal error rather than degrading gracefully or falling back (similar to #8341).

### Logs or stack traces

```shell
DesktopConnectionCatalogStoreProtectionError: Desktop connection catalog protection failed during decrypt-catalog at /Users/<user>/.t3/userdata/connection-catalog.json.
    at /Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:136281:201
    at /Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:4368:91
    at desktop.connectionCatalogStore.get (Nightly)
    at desktop.ipc.connectionCatalog.get (Nightly)
    at desktop.ipc.connectionCatalog.get (definition) (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:136309:11)
    at desktop.ipc.method (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:68969:116)
    at desktop.ipc.invoke (Nightly)
    at desktop.ipc.registerInvoke (Nightly)
    at desktop.ipc.registerInvoke (definition) (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:68908:10)
    at desktop.ipc.installHandlers (Nightly)
    at desktop.ipc.installHandlers (definition) (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:148632:35)
    at desktop.bootstrap (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:159510:9) {
  [cause]: ElectronSafeStorageDecryptError: Electron safe storage failed to decrypt a string.
      at catch (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:69673:22) {
    [cause]: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString.
        at try (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:69672:36)
  }
}
```

### Workaround

Move or delete `~/.t3/userdata/connection-catalog.json` (e.g. `mv ~/.t3/userdata/connection-catalog.json ~/.t3/userdata/connection-catalog.json.bak`) and restart T3 Code Nightly.

The app will generate a clean catalog with the current key, successfully connect to the local backend, and restore access to all SQLite chats and projects. Any remote targets will need to be re-added.

