szn

Bug 133 — server/server.zig — killSession uses swapRemove — silently changes active session

133. server/server.zig — killSession uses swapRemove — silently changes active session

File: src/server/server.zig:1241 Severity: MEDIUM Status: ✅ FIXED — replaced swapRemove with orderedRemove to preserve session ordering. Test added.

var session = self.sessions.swapRemove(idx);

swapRemove replaces the removed element with the last element. Since activeSession() always returns sessions.items[0], killing session[0] silently promotes the last session to active without any notification or state update. If the killed session was being displayed, the display client now shows a different session without re-initialization.