Skip to content

Comments

fix(happy-app): make sessionKill idempotent when process already exited#692

Open
davidrimshnick wants to merge 1 commit intoslopus:mainfrom
davidrimshnick:fix/idempotent-kill-session
Open

fix(happy-app): make sessionKill idempotent when process already exited#692
davidrimshnick wants to merge 1 commit intoslopus:mainfrom
davidrimshnick:fix/idempotent-kill-session

Conversation

@davidrimshnick
Copy link

Summary

  • When tapping "Archive Session" on a session whose process had already exited, the app showed "RPC call failed" because the killSession RPC had no recipient
  • The user's intent is "stop this session" — if it's already stopped, that's a success
  • Changed the sessionKill() catch block to return { success: true, message: 'Session already stopped' } instead of surfacing the RPC error

Fixes #687

Test plan

  • Added unit tests for sessionKill with mocked apiSocket
  • Test verifies RPC success returns success
  • Test verifies RPC failure (process already dead) returns success with "Session already stopped"
  • All 3 tests pass
  • Manual: kill a session's process externally, then tap Archive Session — should succeed without error

🤖 Generated with Claude Code

When archiving a session whose process had already exited, the RPC
call to killSession would fail and show "RPC call failed" to the user.
Since the user's intent is "stop this session", and it's already
stopped, this should be treated as success.

The catch block now returns success with "Session already stopped"
instead of surfacing the RPC error.

Fixes slopus#687

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Archive Session shows 'RPC call failed' when the session process already exited (killSession should be idempotent)

1 participant