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

opened10h agobyKkumar-karan

Before submitting

  • I searched existing issues and did not find a duplicate.
  • 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
1if (platform === "darwin" || platform === "linux") {
2 Electron.app.setName(resolveDesktopSafeStorageName(Electron.app.getVersion()));
3}

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
1DesktopConnectionCatalogStoreProtectionError: Desktop connection catalog protection failed during decrypt-catalog at /Users/<user>/.t3/userdata/connection-catalog.json.
2 at /Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:136281:201
3 at /Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:4368:91
4 at desktop.connectionCatalogStore.get (Nightly)
5 at desktop.ipc.connectionCatalog.get (Nightly)
6 at desktop.ipc.connectionCatalog.get (definition) (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:136309:11)
7 at desktop.ipc.method (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:68969:116)
8 at desktop.ipc.invoke (Nightly)
9 at desktop.ipc.registerInvoke (Nightly)
10 at desktop.ipc.registerInvoke (definition) (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:68908:10)
11 at desktop.ipc.installHandlers (Nightly)
12 at desktop.ipc.installHandlers (definition) (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:148632:35)
13 at desktop.bootstrap (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:159510:9) {
14 [cause]: ElectronSafeStorageDecryptError: Electron safe storage failed to decrypt a string.
15 at catch (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:69673:22) {
16 [cause]: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString.
17 at try (/Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/apps/desktop/dist-electron/main.cjs:69672:36)
18 }
19}

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.