Repository navigation
Description
Summary
The update banner's Download button always opens RELEASES_URL, core's GitHub releases page (src/lib/stores/update-status.svelte.ts:27-28).
That is wrong for a Pro build. Its Rust check polls the Pro source, yet Download sends Pro users to the community installer, which replaces the Pro app. The comment "both free and Pro releases are published here" is also false: Pro ships from nodespace-sync's releases.
The fix:
- the Rust
UpdateStatuspayload carriesdownload_url, set by whichever source found the update; - the banner opens that URL, and hides Download when there is none;
RELEASES_URLis deleted.
This issue owns the payload field, the store and the banner (ADR-082 (proposed) §3.6). #3320 depends on it and only feeds the field from the update source.
Context (main @ af8ddb6; locate by symbol)
-
Source selection.
src-tauri/src/update_check.rscheck_for_update(110-133) picks the source byis_pro_build()(116-124):fetch_pro_latest_versionorfetch_latest_tag. -
The payload.
UpdateStatus(58-63) carriescurrent,latestandupdate_available. -
Callers. The startup spawn in
lib.rs(468-486) andcheck_for_update_command(196-203). -
The Pro worker.
/pro/latest-versionreturns{version, name, published_at}, with no download location. Where Pro users download from is ADR-084's decision, and the Pro package supplies it through Let an app built on core supply its update source through AppExtensions #3320. -
Frontend consumers:
update-status.svelte.ts: the interface (31-36),apply(63-67) anddownload(101-104);src/lib/components/update-banner.svelte: the Download button (29-31);src/tests/stores/update-status.test.ts.
rg RELEASES_URLhits only the store and its test.
Scope
Rust: src-tauri/src/update_check.rs
- Next to
LATEST_RELEASE_URL, addconst RELEASES_PAGE_URL: &str = "https://github.com/NodeSpaceAI/nodespace-core/releases/latest";. Document it as the page a user of the public source downloads from. UpdateStatus: addpub download_url: Option<String>. It serializes asdownload_url,nullwhen absent.no_update: setdownload_urltoNone.- Extract
fn status_from(current: &str, latest: Option<String>, download_url: Option<&str>) -> UpdateStatus, holding the comparison from 125-132. An update carriesdownload_url; no update carriesNone. check_for_update:- the
fetch_latest_tagbranch passesSome(RELEASES_PAGE_URL); - the other branch passes
None. - Keep the branch itself: Let an app built on core supply its update source through AppExtensions #3320 moves it into
BuiltinUpdateSource, and Delete the Pro arm of core's built-in update source and its worker parsing #3323 deletes it. - New comments must not add Pro wording.
- the
- Module doc (21-23): say that the payload names where to download.
- Tests:
- extend
no_update_status_is_current_onlyto assertdownload_url == None; - add
an_update_carries_its_sources_download_url; - add
no_update_carries_no_download_url_even_when_the_source_has_one; - add
an_update_from_a_source_without_a_download_url_has_none.
- extend
Frontend
src/lib/stores/update-status.svelte.ts:- module doc (4-7): change "checks GitHub Releases" to "checks this build's release source";
- delete
RELEASES_URLand its comment (27-28); - add
download_url: string | nullto the interface; - add
downloadUrl = $state<string | null>(null), set inapply()asstatus.download_url ?? null, and acanDownloadgetter; download()opensthis.downloadUrl. When it is null, it callslog.warnand returns without opening anything.
src/lib/components/update-banner.svelte: render Download only whenupdateStatus.canDownload, and keep Later in every case. Update the doc at 2-7.src/tests/stores/update-status.test.ts:- drop the
RELEASES_URLimport; - add
download_urltofireUpdate, to the defaultmockInvokepayload, and to themockResolvedValueOncepayload at 101 (svelte-check fails otherwise); - replace "download opens the releases page" with "download opens the payload's download_url";
- add "download is a no-op without a download_url".
- drop the
- New file
src/tests/components/update-banner.test.ts. Followsrc/tests/components/status-bar.test.tsfor the render setup and the store test for the mocks, and setupdateStatusfields directly. Assert that:- Download renders when a URL is present, and does not render when it is null;
- "Dismiss update notice" renders in both cases.
Out of scope
- Removing the Pro branch or the Pro source (Delete the Pro arm of core's built-in update source and its worker parsing #3323).
- The update-source override (Let an app built on core supply its update source through AppExtensions #3320).
- Choosing the Pro download location (ADR-084; sync).
Coordination
#3320 depends on this issue. It:
- reuses
status_fromin itscheck_for_update_with; - returns
RELEASES_PAGE_URLasBuiltinUpdateSource's download URL for the public source, andNonefor the Pro arm; - adds no
download_urlfield of its own, and has noRELEASES_URLfallback.
Steps
- Run the CLAUDE.md startup sequence with worktree
issue-<N>-update-download-url:git pull origin main;EnterWorktree;bun install;- a
bun run testbaseline; bun run gh:assign <N> "@me";bun run gh:status <N> "In Progress".
- Rust: the payload field, the helper and their tests.
- Frontend: the store, the banner and their tests.
- Run
bun run scripts/check-pro-boundary.tsand paste the printedBASELINES. - Ship:
bun run test:changed;bun run quality:fix, then commit;git push origin HEAD:issue-<N>-update-download-url;gh pr create --repo NodeSpaceAI/nodespace-core --head issue-<N>-update-download-url;/pragmatic-code-review, then/address-review;- after the user approves,
bun run merge <PR#>in the background.
Acceptance criteria
-
UpdateStatusserializesdownload_url. The public source sets it to the releases page when there is an update, andno_updateleaves it null. - A Pro build's update status has
download_url: null, so its banner shows the new version with no Download button. -
rg -n -F -e RELEASES_URL -e 'both free and Pro' packages/desktop-app/srcreturns nothing. - Free app: the banner still opens
github.com/NodeSpaceAI/nodespace-core/releases/latest. - The new and updated tests pass, and
bun run --cwd packages/desktop-app quality:fix(which includes svelte-check) is clean. -
bun run scripts/check-pro-boundary.tspasses, withBASELINESlowered to the printed counts. Expected:proWording−1, from the deletedRELEASES_URLcomment. New code adds no marker line.
Tests and verification
cargo test --lib -p nodespace-app update_checkNODESPACE_PRO_SUPABASE_URL=https://example.invalid NODESPACE_PRO_ANON_KEY=dummy cargo check -p nodespace-appcargo clippy -p nodespace-app --all-targets -- -D warnings -D clippy::unused-asyncbun run --cwd packages/desktop-app test src/tests/stores/update-status.test.ts src/tests/components/update-banner.test.tsbun run test:changed- Mutation-check each new test.
Dependencies
- Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299: the ratchet this PR lowers.
Risks and rollback
- Payload shape change. Both ends change in the same PR, and the store treats a missing field as null.
- Pro builds lose the Download button. A Pro build made from core HEAD loses its (wrong) Download button until the Pro package supplies a download page through Let an app built on core supply its update source through AppExtensions #3320. That is intended.
- Rollback: revert the PR.
Plan key: C4.3 (pro-boundary DAG).
🤖 Generated with Claude Code
Activity
Carry the download URL in the update-check payload (closes #3319)
Carry the download URL in the update-check payload (closes #3319)
Carry the download URL in the update-check payload (closes #3319)