fix(server): surface workspaceFile in project snapshot queries - #213
Merged
LoganRupe merged 1 commit intoSep 3, 2026
Conversation
The projection snapshot queries never selected the workspace_file column and never mapped it, so workspaceFile silently dropped out of every client-facing project shell. Open-in fell back to the folder, the sidebar never showed the workspace icon, and Manage folders never appeared (#185). Select the column in the three project SELECTs and map it in mapProjectShellRow plus the three inline OrchestrationProject literals that build read models from the same rows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
ProjectionSnapshotQuery.tsnow selectsworkspace_filein the three project SELECTs (listProjectRows,getActiveProjectRowByWorkspaceRoot,getActiveProjectRowById) and maps it inmapProjectShellRow. The three inlineOrchestrationProjectliterals built from the same rows (getSnapshot,getCommandReadModel,getActiveProjectByWorkspaceRoot) get the same one-line spread, so the hydrated command read model matches event-evolved state instead of quietly dropping the field.Tests: the hydration test inserts a
workspace_fileand asserts it in the read model and shell snapshot; the targeted-lookup test asserts it throughgetActiveProjectByWorkspaceRootandgetProjectShellById. Both fail without the source change (2/21 red before, 21/21 green after).Why
Fixes #185.
workspaceFilewas persisted correctly but never reached the client because the snapshot queries neither selected the column nor mapped it, andSchema.optionallet both omissions typecheck. That made every consumer dead: "Open in" opened the containing folder instead of the.code-workspace, the sidebar never showed the workspace icon, and "Manage folders" never appeared.Checklist
Written by Claude Fable 5 in T3 Code.