Skip to content

fix(site): download page targets Electron release, auto-release desktop - #373

Merged
crs48 merged 2 commits into
mainfrom
claude/nifty-carson-e7ae7d
Jul 4, 2026
Merged

fix(site): download page targets Electron release, auto-release desktop#373
crs48 merged 2 commits into
mainfrom
claude/nifty-carson-e7ae7d

Conversation

@crs48

@crs48 crs48 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

What & why

Two coupled fixes to the /download page and the desktop release pipeline.

1. Download page linked to the wrong release

download.astro fetched GitHub releases/latest, which returns the most-recently-published release across all tags — currently @xnetjs/trust@0.0.2, an npm-package release with zero desktop assets. So every platform button fell back to the generic releases page. Two asset patterns (x64.dmg, Setup.exe) also didn't match electron-builder's real filenames, so Intel-mac and Windows would break even against the right release.

Fix: fetch the release list and select the newest non-draft release whose tag matches v<number> (the desktop scheme), and match assets by electron-builder's real naming (bare-x64 vs arm64-suffixed, .Setup.N.exe). Simulated against the live GitHub API — all five buttons now resolve to real v0.0.1 assets with zero fallbacks.

2. Electron wasn't auto-releasing (frozen since 2026-03-05)

electron-release.yml only publishes when apps/electron/package.json's version is new, but it was pinned at 0.0.1. Every run since March finished in ~10s with all build jobs skipped — still green, which is why it looked healthy. Desktop users have been stuck on the March build.

Fix (rides the core release train): scripts/changeset/sync-electron-version.mjs pegs xnet-desktop's version to @xnetjs/core (anchor of the changeset fixed group), wired into version-packages so the bump lands in the same "Version Packages" PR. xnet-desktop is private + in changeset ignore, so changesets never versions it on its own — this script is the coupling. Bumped 0.0.1 → 0.0.3 here to unfreeze immediately: merging this cuts a fresh v0.0.3 desktop release built from current main, which the download page then serves.

Tradeoff: a change touching only apps/electron/** (no core changeset) won't trigger a desktop release, since the version won't move — inherent to the core-train approach.

Testing

  • Simulated the exact build-time release/asset resolution against the live GitHub API: correct v0.0.1 release selected, all 5 buttons resolve, no fallbacks.
  • sync-electron-version.mjs verified: 0.0.1 → 0.0.3 and idempotent on re-run.
  • Changeset coverage check passes (no publishable package touched).

🤖 Generated with Claude Code

The /download page fetched GitHub `releases/latest`, which returns the most
recently published release across ALL tags — usually an npm package release
(e.g. `@xnetjs/trust@x.y.z`) that carries no desktop assets — so every button
fell back to the generic releases page. Fetch the release list and pick the
newest non-draft `v<number>` tag (the desktop scheme) instead, and match assets
by electron-builder's real names (bare-x64 vs `arm64`-suffixed; `.Setup.N.exe`).

Desktop was also frozen at the 2026-03-05 `v0.0.1` build: electron-release.yml
only publishes when `apps/electron/package.json`'s version is new, but it was
pinned at 0.0.1, so every run since March was a ~10s no-op. Peg the desktop
version to `@xnetjs/core` (anchor of the changeset `fixed` group) via
scripts/changeset/sync-electron-version.mjs, wired into `version-packages`, so
the bump rides the same "Version Packages" PR and merging cuts a matching
`v<version>` release. Bump 0.0.1 -> 0.0.3 to unfreeze immediately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 temporarily deployed to pr-373 July 4, 2026 15:48 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

✓ Changelog fragment found — thanks!

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 temporarily deployed to pr-373 July 4, 2026 15:49 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Preview removed for PR #373.

github-actions Bot added a commit that referenced this pull request Jul 4, 2026
@crs48
crs48 merged commit 7574bae into main Jul 4, 2026
17 checks passed
@crs48
crs48 deleted the claude/nifty-carson-e7ae7d branch July 4, 2026 16:11
github-actions Bot added a commit that referenced this pull request Jul 4, 2026
crs48 added a commit that referenced this pull request Jul 4, 2026
The **"View release assets and checksums"** link at the bottom of
[`/download`](https://xnet.fyi/download/) pointed at the generic
`/releases` index, which interleaves npm-package releases
(`@xnetjs/core@x.y.z`, `@xnetjs/trust@x.y.z`) with the desktop releases
— so it didn't land on the build being offered.

Now it deep-links to the specific desktop release tag already resolved
for the download buttons (`/releases/tag/v<version>`), falling back to
the index only if no desktop release resolves. Follow-up to #373.

## Testing
Simulated the build-time resolution against the live GitHub API: link
resolves to `https://github.com/crs48/xNet/releases/tag/v0.0.1` (the
current newest desktop release; becomes `v0.0.3` once that build
publishes and the site rebuilds).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
crs48 added a commit that referenced this pull request Jul 4, 2026
…ll (#375)

Follow-up to #373. The desktop auto-release ran a real (non-no-op) build
for the first time since March and surfaced latent breakage on two
platforms (macOS + Linux arm64 build clean; the `release` job needs all
platforms, so nothing publishes until these are fixed).

## Windows — fixed
`@electron/rebuild` runs with `buildFromSource=false`: `better-sqlite3`
uses its downloaded Electron prebuild and finishes instantly, but
**`usearch` and `sharp` have no Electron prebuild**, so they compile
from source. GitHub's `windows-latest` now ships **Visual Studio 2026**
(runner image `Windows2025-VS2026`), which the **node-gyp 9.4.1**
bundled by `@electron/rebuild` is too old to detect → *"Could not find
any Visual Studio installation to use."* That's exactly why the March
build passed (windows-latest was VS 2022 then) and now fails.

**Fix:** pin `build-windows` to the `windows-2022` image, whose VS 2022
node-gyp 9.4.1 detects.

## Linux x64 — instrumented for diagnosis
The packaged app never opens a window (60s `firstWindow` timeout) and
prints **zero output** — deterministic across two runs. Boot `await`s
`spawnDataProcess()` (a `utilityProcess.fork` loading `better-sqlite3`)
**before** `createWindow()`, so if that utility process doesn't signal
ready on packaged Linux x64, the window is never created. macOS packaged
and the unpackaged `electron-e2e` job both pass, so it's specific to the
packaged Linux x64 combination.

The app was silent because its data-process logging is gated behind an
IPC toggle that needs a renderer (which never exists here), and the
`whenReady` chain had no `.catch`. This PR makes the failure observable:
- `data-process-manager.ts`: honor `XNET_DEBUG=1` at startup to emit the
boot trace without a renderer.
- `index.ts`: add a `.catch` on the `whenReady` chain so a pre-window
boot failure logs to stderr instead of dying silently (a genuine
robustness fix — users currently get a dead app with no clue).
- smoke step runs with `XNET_DEBUG=1 E2E_DEBUG=1` so CI captures the
real cause.

After this lands I'll dispatch `electron-release` to confirm Windows
goes green and read the Linux x64 boot trace, then land the precise
Linux fix.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
crs48 added a commit that referenced this pull request Jul 5, 2026
## Summary

Implements exploration 0265: every `npm Release` run on main has failed
since 2026-07-04 because `sync-electron-version.mjs` (PR #373) bumps
`xnet-desktop` inside `pnpm version-packages`, and `changesets/action`
then crashes with ENOENT reading the nonexistent
`apps/electron/CHANGELOG.md` (changesets/action#256). The Version
Packages PR #281 has been frozen since, and nothing can publish.

- **fix(release):** the sync script now owns the desktop changelog —
seeds `apps/electron/CHANGELOG.md` and prepends a matching `##
<version>` entry on every core-train bump (idempotent; exported function
+ `node:test` coverage; verified end-to-end with a local `pnpm
version-packages` run).
- **ci(release):** a red `npm Release` run now opens (or comments on) a
single deduped alarm issue instead of failing silently — 12 consecutive
failures went unnoticed.
- **docs:** release-cadence policy in `CLAUDE.md` (merge the refreshed
Version Packages PR after each exploration lands; `.changeset/` pile-up
is the stall litmus) + the 0265 exploration doc.

Staged-bump audit: no majors pending; the fixed core group will release
as **0.1.0** (minor) — appropriate for the queued changesets.

## Test plan

- [x] `node --test scripts/changeset/sync-electron-version.test.mjs` (5
tests)
- [x] Local `pnpm version-packages` repro: 0.0.3 → 0.1.0 bump writes the
changelog entry, no ENOENT
- [ ] Post-merge: next `npm Release` run on main goes green and
refreshes PR #281 with the 0263/0264 changesets

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

1 participant