Skip to content

Fix crash when saving settings on repo-less Category projects - #11

Open
kbantoft wants to merge 1 commit into
per-simmons:mainfrom
kbantoft:fix/category-project-settings-crash
Open

Fix crash when saving settings on repo-less Category projects#11
kbantoft wants to merge 1 commit into
per-simmons:mainfrom
kbantoft:fix/category-project-settings-crash

Conversation

@kbantoft

@kbantoft kbantoft commented Jul 9, 2026

Copy link
Copy Markdown

Summary

  • Category projects (grouping-only, no shared git repo) store mainRepoPath as "". Saving Scripts settings for one of these called mkdir on a bare .superset path relative to cwd, throwing an uncaught ENOENT that crashed the app — matches [bug] the title of bug report #6.
  • Guarded the config tRPC router's procedures (ensureConfigExists, hasConfiguredScripts, getConfigFilePath, getConfigContent, getSetupOnboardingDefaults) against an empty mainRepoPath instead of touching the filesystem with a bogus relative path.
  • ScriptsEditor's save mutation now surfaces errors via a toast instead of failing silently.
  • Also fixed a related directory-name mismatch: config.ts hardcoded the literal .superset, while loadSetupConfig (used by setup detection) actually reads the PROJECT_SUPERSET_DIR_NAME constant (.ade) — so scripts saved via Settings were never picked up by setup detection. Aligned config.ts and the setup.test.ts/teardown.test.ts fixtures to the shared constant.

Fixes #6

Test plan

  • bun test in apps/desktop — all tests in config, workspaces/utils/{setup,teardown,git} pass (50/50)
  • Built the app locally (electron-vite build + electron-builder --dir) and reproduced the original crash against a copy of real project data containing repo-less Category projects — saving Scripts settings no longer crashes the app

Category projects (grouping-only, no shared git repo) store mainRepoPath
as "". Saving Scripts settings called mkdir on a bare ".superset" path
relative to cwd, throwing an uncaught ENOENT and crashing the app
(per-simmons#6). Guard config.ts's procedures against an empty mainRepoPath, and
surface save errors in the UI instead of failing silently.

Also fixes a directory-name mismatch: config.ts hardcoded ".superset"
while loadSetupConfig actually reads PROJECT_SUPERSET_DIR_NAME (".ade"),
so scripts saved via Settings were never picked up by setup detection.
Aligned config.ts and the setup/teardown test fixtures to the shared
constant.

Fixes per-simmons#6

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

[bug] the title of bug report

2 participants