You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Problem
Git fetch was only running once per project per polling cycle. This
optimization worked for local workspaces that share a git repository,
but broke for SSH workspaces where each workspace has its own
independent git repository.
## Solution
Changed the fetch key logic to distinguish between local and SSH
workspaces:
- **Local workspaces**: Use `projectName` as fetch key → one fetch
serves all workspaces (efficient)
- **SSH workspaces**: Use `workspaceId` as fetch key → each workspace
gets its own fetch (correct)
## Changes
- Add `getFetchKey()` to determine fetch key based on runtime type
- Rename `tryFetchNextProject` → `tryFetchWorkspaces`
- Rename `fetchProject` → `fetchWorkspace`
- Remove `groupWorkspacesByProject` (no longer needed)
## Impact
### Before (Bug)
```
Polling Cycle 1:
SSH Workspace A (project-x) ───┐
SSH Workspace B (project-x) ───┼─→ Fetch key: "project-x"
SSH Workspace C (project-x) ───┘ ❌ Only ONE fetch runs
```
### After (Fixed)
```
Polling Cycle 1: SSH Workspace A (id: abc123) ──→ Fetch key: "abc123" ✓
Polling Cycle 2: SSH Workspace B (id: def456) ──→ Fetch key: "def456" ✓
Polling Cycle 3: SSH Workspace C (id: ghi789) ──→ Fetch key: "ghi789" ✓
```
This ensures SSH workspaces get fresh git status updates while
maintaining efficient fetch behavior for local workspaces.
## Testing
The existing tests in `GitStatusStore.test.ts` continue to pass. The
changes only affect internal fetch scheduling logic and maintain
backward compatibility for local workspaces.
0 commit comments