Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): opening a large database no longer blocks startup for minutes #21122

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/21122/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 7 changed files with 8 additions and 1 deletion (loading 4).

x
0 of 7 viewed, 7 left
3 additions and 1 deletionapps/desktop/src/window/DesktopApplicationMenu.tsModified
View file
@@ -106,8 +106,10 @@
return;
​
+ // The result dialogs need no main window. Opening one before the backend
+ // answers strands the renderer on a failed auth bootstrap.
const desktopWindow = yield* DesktopWindow.DesktopWindow;
- yield* desktopWindow.ensureMain;
+ yield* desktopWindow.activate;
Resolvedby t3dotgg(GitHub profile, opens in a new tab)
yield* checkForUpdatesFromMenu;
}).pipe(Effect.withSpan("desktop.menu.handleCheckForUpdatesClick"));
​
2 additions and 0 deletionsapps/server/src/orchestration-v2/ProjectionStore.tsModified
View file
@@ -3965,6 +3965,8 @@
`.pipe(Effect.flatMap(decodeRows(decodeRunAttemptPayload, threadId)));
const nodes = yield* sql<PayloadRow>`
SELECT payload_json FROM orchestration_v2_projection_nodes
+ -- Look up the root node by key, not every node in the thread.
+ INDEXED BY sqlite_autoindex_orchestration_v2_projection_nodes_1
WHERE thread_id = ${threadId} AND node_id IN (SELECT json_extract(payload_json, '$.rootNodeId') FROM orchestration_v2_projection_runs WHERE thread_id = ${threadId} AND run_id = ${runId}) ORDER BY node_id ASC
`.pipe(Effect.flatMap(decodeRows(decodeNodePayload, threadId)));
const subagents = yield* sql<PayloadRow>`
3 additions and 0 deletionsapps/server/src/orchestration-v2/ThreadFind.tsModified
View file