Fix crash when saving settings on repo-less Category projects - #11
Open
kbantoft wants to merge 1 commit into
Open
Fix crash when saving settings on repo-less Category projects#11kbantoft wants to merge 1 commit into
kbantoft wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainRepoPathas"". Saving Scripts settings for one of these calledmkdiron a bare.supersetpath relative to cwd, throwing an uncaughtENOENTthat crashed the app — matches [bug] the title of bug report #6.configtRPC router's procedures (ensureConfigExists,hasConfiguredScripts,getConfigFilePath,getConfigContent,getSetupOnboardingDefaults) against an emptymainRepoPathinstead of touching the filesystem with a bogus relative path.ScriptsEditor's save mutation now surfaces errors via a toast instead of failing silently.config.tshardcoded the literal.superset, whileloadSetupConfig(used by setup detection) actually reads thePROJECT_SUPERSET_DIR_NAMEconstant (.ade) — so scripts saved via Settings were never picked up by setup detection. Alignedconfig.tsand thesetup.test.ts/teardown.test.tsfixtures to the shared constant.Fixes #6
Test plan
bun testinapps/desktop— all tests inconfig,workspaces/utils/{setup,teardown,git}pass (50/50)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