Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

Commit e8110e3

Browse files
refactor: extract shared cloud IPC message handler and fix Discord TS error (#143)
Two improvements in this PR: 1. **Extract `makeCloudMessageHandler` in `ipc.ts`** — the `processMessage` callback passed to both `startSpritesIpcPoller` and `startDaytonaIpcPoller` was copy-pasted verbatim (16 lines each), differing only in the log label. Extracted into a shared factory `makeCloudMessageHandler(deps)` that accepts a `backendLabel` string for the logger. Also extracts the `processTask` handler into a shared `cloudTaskHandler` constant. Net change: removes ~12 lines of duplication, single place to update routing logic when adding future cloud backends. 2. **Fix `mentionsOtherUsersOnly` type error in `discord.ts`** — `botId` is `string | undefined`, but `Map.has()` requires `string`. Added `botId != null` guard at the start of the expression so TypeScript can narrow the type. No behavior change (outer `if (!isDM && botId && ...)` already guarded it), but eliminates the pre-existing TS2345 error. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7296c99 commit e8110e3

2 files changed

Lines changed: 368 additions & 124 deletions

File tree

0 commit comments

Comments
 (0)