Repository navigation
fix: split snapshot handler helpers and preserve wait cleanup semantics - #249
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1ca5eeac6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }, | ||
| }; | ||
| } | ||
| const { session, device } = await resolveSessionDevice(sessionStore, sessionName, req.flags); |
There was a problem hiding this comment.
Validate settings args before resolving target device
Calling resolveSessionDevice before handleSettingsCommand changes the settings error path: when the user passes invalid/missing args without an existing session, the command now tries device discovery first and can fail with DEVICE_NOT_FOUND instead of returning the expected INVALID_ARGS usage message. This is a regression from prior behavior and is reproducible in environments without connected simulators/devices (it also breaks the existing settings usage hint test).
Useful? React with 👍 / 👎.
|
Summary
Refactor the snapshot handler into focused helper modules for capture, wait, session, alert, and settings flows.
Preserve sessionless
wait <duration>behavior by bypassing runner cleanup on the sleep path and add regression coverage for it.Reuse shared snapshot normalization and session construction helpers to reduce duplicated logic while keeping command behavior unchanged.
Closes #158.
Validation
node --test src/daemon/handlers/__tests__/snapshot.test.ts src/daemon/handlers/__tests__/snapshot-handler.test.tspnpm format,pnpm typecheck,pnpm test:unit,pnpm test:smoke