Fix task creation reload in dev#17
Conversation
|
Thank you very much and sorry for the late reply. Haven't configured the notifcations for this repo properly. |
johannesjo
left a comment
There was a problem hiding this comment.
Review Feedback
Overall this looks good and safe to merge. Three small, well-scoped fixes. One item worth discussing:
await saveState() — consider fire-and-forget
await saveState() in both createTask and createDirectTask adds disk I/O latency to the task creation return path. Since saveState() already has its own .catch() handler internally, calling it without await would give the same persistence guarantee without blocking the caller:
saveState(); // fire-and-forget — errors handled internallyThe only reason to keep await would be if you need the write fully flushed before returning, but a Vite dev reload (triggered by a file watcher in a separate process) is extremely unlikely to race with the same event loop tick.
Minor: PR description doesn't mention the preload quote fix
The hasChannel fix in main.ts (matching single-quoted channels in preload.cjs) is a separate bug fix from the reload/persistence changes. Worth calling out in the description or splitting into its own commit for cleaner history.
Nitpick: siblingWorktreesDir naming
This variable actually resolves to the parent directory, not specifically a worktrees directory. parentDir would be more precise, though the intent is clear from context.
|
Thank you very much! <3 |
StepEntry.summary is typed as required but AI-written steps.json may omit it; truncate() called text.length unconditionally, throwing TypeError: Cannot read properties of undefined (reading 'length'). Added ?? '' fallback matching existing pattern for detail/status.
Filter non-object entries in setStepsContent so null/primitive values in steps.json never reach the render. Also tighten the files_touched Show guard to Array.isArray to prevent iterating non-array values.
… watch - Expand preload allowlist check to match both single- and double-quoted channel names in preload.cjs (verifyPreloadAllowlist) - Exclude sibling git worktree directories from Vite's file watcher to prevent spurious HMR reloads during multi-worktree dev sessions - Persist task state immediately after createTask so tasks survive a dev reload; fire-and-forget since saveState handles errors internally
c053704 to
6cbde93
Compare
Summary
Testing