Skip to content

[Backend][Info] WebSocket session polls not cleaned up when session is killed #1122

@OneStepAt4time

Description

@OneStepAt4time

Summary

ws-terminal.ts:95-103,190-200sessionPolls entries are cleaned up when all WebSocket subscribers disconnect. However, if a session is killed via the API, existing subscribers are not notified and the shared poll timer continues calling tmux.capturePane on a non-existent window, failing silently forever.

Files Affected

  • src/ws-terminal.ts:95-103, 190-200

Suggested Fix

When a session is killed, actively close all WebSocket connections for that session and clean up the poll entry. Or have the poll detect session death and self-terminate.


Code review finding from full codebase audit (2026-04-04)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions