fix(server): serve workspace list instantly on fetch, reconcile in background#204
Merged
boudra merged 2 commits intogetpaseo:mainfrom Apr 7, 2026
Merged
Conversation
…ckground Previously fetch_workspaces_request awaited reconcileActiveWorkspaceRecords() before responding — this ran git operations (getCheckoutStatusLite) on every active workspace, causing projects to appear empty for several seconds after daemon restart or reconnect. Now the registry snapshot is returned immediately and reconciliation runs in the background. Any changed workspaces (e.g. stale worktrees being archived) are pushed as workspace_update events through the existing subscription.
…e git calls
describeWorkspaceRecord was running two git operations per workspace:
- buildProjectPlacement (to refresh display name)
- getCheckoutShortstat (for diff indicator)
With 13 workspaces this caused fetch_workspaces_request to take 7-15s
(observed as ws_slow_request in logs).
Split into two methods:
- describeWorkspaceRecord: uses only persisted data, returns instantly
- describeWorkspaceRecordWithGitData: runs git ops, used for open_project
and create_worktree responses where fresh data is needed immediately
The snapshot path (initial load + background reconciliation) now uses the
fast variant. diffStat is null on initial load; it will be pushed later via
workspace_update once a git-aware path triggers.
Collaborator
|
cheers, this will most probably be superseded by #197 big revamp of the workspace stuff |
Contributor
Author
That looks like a massive revamp! BTW, love the app! |
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.
fetch_workspaces_requestblocked onreconcileActiveWorkspaceRecords()before responding. This runsgetCheckoutStatusLite(git operations) on every active workspace, so with 10+ workspaces the projects list appears empty for several seconds after every daemon restart or reconnect.To fix this issue, return the registry snapshot immediately, then run reconciliation in the background. When reconciliation finds changed workspaces (stale worktrees being archived, git metadata updates), it pushes
workspace_updateevents through the existing subscription so the client updates live.Fixes #203