Skip to content

Fix task creation reload in dev#17

Merged
johannesjo merged 3 commits intojohannesjo:mainfrom
joshdoe:fix/task-creation-reload
Apr 15, 2026
Merged

Fix task creation reload in dev#17
johannesjo merged 3 commits intojohannesjo:mainfrom
joshdoe:fix/task-creation-reload

Conversation

@joshdoe
Copy link
Copy Markdown
Contributor

@joshdoe joshdoe commented Mar 9, 2026

Summary

  • preserve task creation behavior during Electron dev reloads
  • include the needed dev config handling in the main process and Electron Vite setup

Testing

  • not run here

@johannesjo
Copy link
Copy Markdown
Owner

Thank you very much and sorry for the late reply. Haven't configured the notifcations for this repo properly.

Copy link
Copy Markdown
Owner

@johannesjo johannesjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 internally

The 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.

@johannesjo
Copy link
Copy Markdown
Owner

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
@johannesjo johannesjo force-pushed the fix/task-creation-reload branch from c053704 to 6cbde93 Compare April 15, 2026 14:20
@johannesjo johannesjo marked this pull request as ready for review April 15, 2026 14:21
@johannesjo johannesjo merged commit 47b76ee into johannesjo:main Apr 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants