Skip to content

Give a dev run its own data folder - #226

Merged
nthomsencph merged 5 commits into
mainfrom
fix/210-dev-user-data
Nov 9, 2026
Merged

nthomsencph merged 5 commits into
mainfrom
fix/210-dev-user-data

Conversation

@nthomsencph

Copy link
Copy Markdown
Collaborator

What was wrong

A dev run without DASH_USER_DATA_DIR used the installed app's userData (~/Library/Application Support/Dash/). It shared app.db, the control port and token files and the single-instance lock, so every outside dashctl call went to the dev build without saying so. The version half of the issue was fixed in 23fb283.

What changed

  • src/main/userDataDir.ts: a small pure function picks the folder. DASH_USER_DATA_DIR wins. Otherwise an unpackaged run gets <appData>/Dash-dev, and a packaged one keeps Electron's default. entry.ts applies it before anything reads userData.
  • dashctl version now prints JSON, {"version":"0.22.0","packaged":true}, like the other commands. A dev run says "packaged":false.
  • README and CLAUDE.md: a dev run keeps its data in Dash-dev/ and starts with an empty DB (copy app.db over for real data). DASH_USER_DATA_DIR plus DASH_DEV_URL are only for an extra instance.

The hook-port path, the dashctl script and the control files all come from app.getPath('userData'), so they follow the new folder. Nothing else hard-codes Application Support/Dash.

Verification

  • pnpm type-check and pnpm lint pass (0 errors).
  • pnpm test: 1719 passed, 3 skipped. That includes new tests for userDataDir and updated dashctl version tests.
  • Not launched in Electron.

Fixes #210

🤖 Generated with Claude Code

An unpackaged run without DASH_USER_DATA_DIR now uses <appData>/Dash-dev
instead of the installed app's Dash folder, so it no longer shares app.db,
the control port and token files or the single-instance lock, and outside
dashctl calls keep reaching the installed app. DASH_USER_DATA_DIR still wins.

dashctl version now answers {"version": ..., "packaged": ...}.

Fixes #210

Claude goes brr.. via Dash
A plain copy while Dash runs can miss writes still in app.db-wal.

Claude goes brr.. via Dash
Claude goes brr.. via Dash
With its own Dash-dev folder a fresh dev run wrote enabled: true, so dev
copies sent usage statistics. A new config now defaults to app.isPackaged.

Claude goes brr.. via Dash
packaged already says it is a dev run, so the version drops its (dev)
suffix and stays parseable. version and packaged travel as one BuildInfo.

Claude goes brr.. via Dash
@nthomsencph
nthomsencph merged commit 55ee982 into main Nov 9, 2026
5 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.

A dev run reports Electron's version as Dash's, and shares the installed app's data folder

1 participant