-
Notifications
You must be signed in to change notification settings - Fork 0
fix(linux): stop shipping the broken snap so the release writes latest-linux.yml #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1a3043a
fix(ci): publish the snap to GitHub so latest-linux.yml is written
dantheuber 70b1cb6
fix(packaging): replace the placeholder app description
dantheuber 0c0ae0d
ci(snap): upload the snap to the Snap Store as a non-fatal step
dantheuber e0561d5
fix(snap): bump electron-builder to 26.15.7 to fix a broken snap
dantheuber 929bdea
Revert "ci(snap): upload the snap to the Snap Store as a non-fatal step"
dantheuber 15fef5c
build(linux): stop shipping the snap
dantheuber 446f0e0
fix(dev): give dev builds their own userData profile
dantheuber c358cd6
chore(renderer): drop dead settings.css link
dantheuber e258a78
[ci skip] okf bundle - document dev builds deferring to installed ins…
dantheuber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
48 changes: 48 additions & 0 deletions
48
okf-bundle/gotchas/dev-builds-defer-to-an-installed-instance.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| --- | ||
| type: gotcha | ||
| title: Dev Builds Silently Defer to an Installed Instance | ||
| tags: | ||
| - development | ||
| - electron | ||
| - linux | ||
| timestamp: 2026-08-17T04:02:57.964Z | ||
| status: stable | ||
| --- | ||
|
|
||
| `npm run dev` uses the same `userData` directory as an installed Clipless | ||
| (`~/.config/clipless` on Linux). The app takes a single-instance lock in | ||
| `src/main/index.ts`, so when an installed copy is already running the dev | ||
| instance **fails the lock and calls `app.quit()` immediately** — and the | ||
| *installed* process receives `second-instance` and shows its own window | ||
| (`src/main/app/index.ts`). | ||
|
|
||
| The failure mode is that this looks like success: a Clipless window pops to the | ||
| front the moment dev starts. Nothing indicates the window belongs to a different | ||
| build. Symptoms: | ||
|
|
||
| - Code changes never appear, no matter how many times you rebuild. | ||
| - Bugs you already fixed keep reproducing "in dev". | ||
| - `electron-vite dev` prints `start electron app...` and then exits 0 within seconds. | ||
|
|
||
| Clipless minimizes to tray, so closing its window does not quit it — an installed | ||
| copy can hold the lock for weeks without being noticed. | ||
|
|
||
| Diagnosis: `ps -o pid,lstart,cmd -C clipless`. If a process predates your last | ||
| build, that is what you are looking at. | ||
|
|
||
| Two ways out: | ||
|
|
||
| - `pkill -f '/opt/Clipless/clipless'` before starting dev. Clips are persisted | ||
| under `~/.config/clipless/clipless-data` and survive. | ||
| - Give dev its own profile: `npx electron-vite dev -- --user-data-dir=/tmp/clipless-dev`. | ||
| This also keeps dev runs from mutating real clip history — related: | ||
| [E2E Tests Touch the Real System Clipboard](/gotchas/e2e-tests-touch-system-clipboard.md). | ||
|
|
||
| The same shadowing hits packaged installs: `apt install` of a new .deb does not | ||
| restart a running app, and replacing `app.asar` under a live process invalidates | ||
| the archive offsets it cached — reads of `settings.html` then return bytes from | ||
| the middle of another packed file, and the settings window renders that JS as | ||
| plain text. It looks like a renderer bug; it is a stale process. | ||
|
|
||
| See also [Non-Blocking Startup](/decisions/non-blocking-startup.md) for the | ||
| single-instance lock in its intended role. |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { app } from 'electron'; | ||
| import { is } from '@electron-toolkit/utils'; | ||
|
|
||
| // Dev builds otherwise share the installed app's userData directory, and with it | ||
| // the single-instance lock. When an installed Clipless is running in the tray, | ||
| // `npm run dev` loses that lock, quits immediately, and the installed copy | ||
| // handles 'second-instance' by focusing its own window — so a window appears, | ||
| // the freshly built code never runs, and nothing indicates which build you are | ||
| // looking at. A separate profile also keeps dev runs from mutating real clips. | ||
| // | ||
| // This has to happen before any module derives a path from userData, and the | ||
| // storage singleton does so in its constructor at import time. Hence a | ||
| // side-effect module imported first in src/main/index.ts rather than a call in | ||
| // that file's body: ES module imports are evaluated before the importing | ||
| // module's statements. | ||
| if (is.dev) { | ||
| app.setPath('userData', `${app.getPath('userData')}-dev`); | ||
| } |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.