Skip to content

Fix task creation reload in dev#17

Draft
joshdoe wants to merge 1 commit intojohannesjo:mainfrom
joshdoe:fix/task-creation-reload
Draft

Fix task creation reload in dev#17
joshdoe wants to merge 1 commit intojohannesjo:mainfrom
joshdoe:fix/task-creation-reload

Conversation

@joshdoe
Copy link

@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
Owner

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

Copy link
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.

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