-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Opportunity
OverviewView.tsx calls api.get('/api/terminals') to fetch the entire terminal list every time it receives terminals.changed, terminal.exit, terminal.detached, or terminal.attach.ready WebSocket events. This is an unbounded full-list re-fetch for what is often a single-terminal change.
Analysis
The server already broadcasts terminals.changed with a revision number. The terminal directory read model and revision-based polling infrastructure already exist. The fix would be to use these existing mechanisms instead of re-fetching the full list, or adopt a delta pattern with upsert/remove events similar to terminal.meta.updated.
Impact
Medium impact, low complexity. With many terminals open, each lifecycle event triggers a full HTTP round-trip and JSON parse of the entire terminal directory.
Action
Investigate and validate this opportunity. Determine the right implementation approach following TDD.