Compare commits

..

10 commits

Author SHA1 Message Date
avi
67ca9cbb76 chore(release): bump to 0.1.17 2026-10-05 19:03:41 -05:00
avi
6c8b82940a chore(release): bump to 0.1.16 2026-10-05 18:11:24 -05:00
avi
aebfa26308 fix(updater): relaunch survives the handoff unit's cgroup sweep
v0.1.15 update proved the pipeline end-to-end (download, verify, swap OK)
but the app never reopened: the handoff runs in a systemd transient unit
whose default KillMode=control-group sweeps the process tree when the
script exits, killing the backgrounded relaunch before Electron started.
Two fixes: start the unit with KillMode=process, and setsid the relaunch
(nohup fallback) so it detaches from the unit session entirely.
2026-10-05 18:11:24 -05:00
avi
328b24d5a6 chore(release): bump to 0.1.15 2026-10-05 17:48:04 -05:00
avi
ced074a3a0 fix(single-instance): quit when the lock is lost
requestSingleInstanceLock() without a quit on failure means the second
process falls through to whenReady() and opens a duplicate window (what
Avi saw: two Folios from one icon click). Now the loser forwards to the
running window (second-instance) and exits. Pairs with the launcher
TMPDIR pin — uwsm per-scope /tmp made the singleton socket invisible, so
the lock never even failed before.
2026-10-05 17:48:04 -05:00
avi
44b4737a20 fix(build): emit linux x86_64 tar.gz on every package run
The in-app updater installs the release asset matched by pickAsset
(tar.gz + linux + x86_64/amd64); the config only built AppImage+deb, so
plain 'npm run package' produced no updatable asset and required a second
electron-builder invocation plus a manual rename (as done for 0.1.13).
2026-10-05 10:42:41 -05:00
avi
ea2ca08efd chore(release): bump to 0.1.14 2026-10-05 10:34:11 -05:00
avi
173a9799d0 chore(release): bump to 0.1.13 2026-10-05 06:28:47 -05:00
avi
bb758580d7 fix(build): prepackage hook rebuilds dist before electron-builder
Root cause of 0.1.8-0.1.12 shipping stale code: electron-builder packs
whatever dist/ happens to contain; dist was last built 2026-10-04 10:02,
so releases 0.1.8..0.1.12 all carried byte-identical bundles that predate
the systemd-run handoff fix (12977e1) and the curl downloader (9afe49c).
prepackage guarantees a fresh build on every npm run package.
2026-10-05 06:28:41 -05:00
avi
b1586c5e25 chore: sync lockfile version to 0.1.12 2026-10-05 01:33:17 -05:00
5 changed files with 26 additions and 4 deletions

View file

@ -21,6 +21,11 @@ linux:
target:
- AppImage
- deb
# tar.gz is what the in-app updater installs (pickAsset looks for a
# linux x86_64/amd64 tarball); arch must be x64 so the asset name ends
# in -linux-x86_64 like every published release.
- target: tar.gz
arch: x64
# OS file associations: double-click / "Open with Folio" on Markdown and
# plain-text files imports them as books (see folio:openPathOrImport and

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "folio",
"version": "0.1.10",
"version": "0.1.17",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "folio",
"version": "0.1.10",
"version": "0.1.17",
"license": "MIT",
"dependencies": {
"@tiptap/core": "^2.27.2",

View file

@ -1,6 +1,6 @@
{
"name": "folio",
"version": "0.1.12",
"version": "0.1.17",
"description": "A simple, local, open-source desktop writing app.",
"productName": "Folio",
"author": "Folio Contributors",
@ -15,6 +15,7 @@
"dev": "concurrently -k \"npm run build:watch\" \"wait-on dist/main.js && npm run electron\"",
"start": "npm run build && npm run electron",
"lint": "tsc --noEmit",
"prepackage": "npm run build",
"test": "node tests/run-project-test.mjs && node tests/run-chapters-test.mjs && node tests/run-wikilinks-test.mjs && node tests/run-office-export-test.mjs && node tests/run-migration-test.mjs && node tests/run-editor-test.mjs && node tests/run-fullbook-test.mjs && node tests/run-print-test.mjs && node tests/run-update-import-test.mjs && node tests/run-update-installer-test.mjs && node tests/run-snapshots-test.mjs && node tests/run-search-test.mjs",
"package": "electron-builder"
},

View file

@ -1354,6 +1354,11 @@ handleIpc("folio:performUpdate", async () => {
execFileSync("systemd-run", [
"--user", "--quiet", "--collect",
`--description=Folio updater handoff`,
// Default KillMode=control-group means the unit's cgroup is swept
// when the script exits — that killed the backgrounded relaunch
// before Electron got to start (v0.1.15 update: swap OK, app died).
// KillMode=process lets the script exit while its child app lives.
"--property=KillMode=process",
"/bin/sh", script,
], { timeout: 10_000, stdio: "ignore" });
handedOff = true;
@ -1423,4 +1428,8 @@ if (app.requestSingleInstanceLock()) {
}
if (f) openFromArg(f);
});
} else {
// Lost the lock: another Folio is already running. Without this quit the
// second process falls through to whenReady() and opens a duplicate window.
app.quit();
}

View file

@ -224,7 +224,14 @@ export function buildInstallerScript(spec: InstallerSpec): string {
' rm -rf "$NEW"',
"fi",
'say "relaunching"',
'"$RELAUNCH" >/dev/null 2>&1 &',
// Detach fully: setsid moves the relaunch into its own session so it
// survives this script's exit and any cgroup sweep of the transient
// unit (systemd KillMode). Fallback chain for missing setsid.
'if command -v setsid >/dev/null 2>&1; then',
' setsid "$RELAUNCH" >/dev/null 2>&1 < /dev/null &',
'else',
' nohup "$RELAUNCH" >/dev/null 2>&1 < /dev/null &',
"fi",
"",
].join("\n");
}