Skip to content

Commit 1cd3d99

Browse files
authored
Refactor big IPC handlers (#3457)
## Summary - Split app runtime process/proxy/cloud sandbox behavior out of app_handlers into an app runtime service. - Move chat attachment delivery policy and formatting out of chat_stream_handlers into a chat attachment service. - Includes the existing Sentry Electron init/dependency changes that were already present in the working tree when pushing. ## Test plan - npm run fmt - npm run lint:fix - npm run ts - npm test 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent f23e25a commit 1cd3d99

5 files changed

Lines changed: 1087 additions & 1110 deletions

File tree

rules/electron-ipc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ writeSettings({
7777
- For **non-bug** failures (validation, not found, auth, user refusal, etc.), prefer `DyadError` with the right `DyadErrorKind` so PostHog does not flood with `$exception` events — see [rules/dyad-errors.md](dyad-errors.md).
7878
- Use `createTypedHandler(contract, handler)` which validates inputs at runtime via Zod.
7979
- Avoid unguarded top-level `app.on(...)` or similar Electron API calls in modules that are imported broadly by tests. Many unit tests mock only the Electron APIs they touch, so prefer guarded calls like `app?.on?.(...)` or move event registration behind an explicit initialization function.
80+
- When splitting large handlers behind service boundaries, leave the handler responsible for IPC registration and request orchestration while moving runtime/policy logic into `src/ipc/services/*`. Preserve any intentional module side effects in the extracted service, such as `fixPath()` for child process PATH setup.
8081

8182
## React Query key factory
8283

0 commit comments

Comments
 (0)