fix: listener leaks, abort sessions on delete, bump diff viewer#19
Merged
fix: listener leaks, abort sessions on delete, bump diff viewer#19
Conversation
- Add { once: true } to abort listeners in ipc/acp/remote chat transports
to prevent AbortSignal listener accumulation.
- Add abortClaudeSessionsForSubChats() helper and call it from
projects.delete, chats.delete, and chats.deleteSubChat so in-flight
Claude sessions are aborted before their workspace is removed.
- Bump @pierre/diffs to 1.1.0-beta.18.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up patches addressing a few remaining items from the bug sweep:
abortlisteners inipc,acp, andremotechat transports were registered without{ once: true }, leaving entries attached to the signal past their single use. Added theonceoption so they're auto-removed after firing.abortClaudeSessionsForSubChats()inclaude.tsand wired it intoprojects.delete,chats.delete, andchats.deleteSubChatso controllers are aborted and evicted fromactiveSessionsbefore the cascade.@pierre/diffsfrom^1.0.10to1.1.0-beta.18(theme integration fixes).bun installran clean.Already-fixed items confirmed in tree (no changes needed): double-click guard on new chat, custom slash command
projectPath, PostHog analytics, Cmd+[ / Cmd+] sub-chat nav, approve-planisActiveguard in split view, LRU cache eviction. The "write lock map" item doesn't apply — no such map exists in this codebase.Changes
src/renderer/features/agents/lib/ipc-chat-transport.ts{ once: true }on abort listenersrc/renderer/features/agents/lib/acp-chat-transport.ts{ once: true }on abort listenersrc/renderer/features/agents/lib/remote-chat-transport.ts{ once: true }on abort listenersrc/main/lib/trpc/routers/claude.tsabortClaudeSessionsForSubChats(ids)helpersrc/main/lib/trpc/routers/projects.tssrc/main/lib/trpc/routers/chats.tschats.deleteanddeleteSubChatpackage.json/bun.lock@pierre/diffs→1.1.0-beta.18Test plan
activeSessions.@pierre/diffsbuild, theme integration intact.tsc --noEmiterror count unchanged frommainbaseline (no regressions from this PR).