Skip to content

Carry the download URL in the update-check payload instead of a hardcoded releases page #3319

Closed

Description

@mstomar125

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 UpdateStatus payload carries download_url, set by whichever source found the update;
  • the banner opens that URL, and hides Download when there is none;
  • RELEASES_URL is 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.rs check_for_update (110-133) picks the source by is_pro_build() (116-124): fetch_pro_latest_version or fetch_latest_tag.

  • The payload. UpdateStatus (58-63) carries current, latest and update_available.

  • Callers. The startup spawn in lib.rs (468-486) and check_for_update_command (196-203).

  • The Pro worker. /pro/latest-version returns {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) and download (101-104);
    • src/lib/components/update-banner.svelte: the Download button (29-31);
    • src/tests/stores/update-status.test.ts.

    rg RELEASES_URL hits only the store and its test.

Scope

Rust: src-tauri/src/update_check.rs

  • Next to LATEST_RELEASE_URL, add const 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: add pub download_url: Option<String>. It serializes as download_url, null when absent.
  • no_update: set download_url to None.
  • Extract fn status_from(current: &str, latest: Option<String>, download_url: Option<&str>) -> UpdateStatus, holding the comparison from 125-132. An update carries download_url; no update carries None.
  • check_for_update:
  • Module doc (21-23): say that the payload names where to download.
  • Tests:
    • extend no_update_status_is_current_only to assert download_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.

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_URL and its comment (27-28);
    • add download_url: string | null to the interface;
    • add downloadUrl = $state<string | null>(null), set in apply() as status.download_url ?? null, and a canDownload getter;
    • download() opens this.downloadUrl. When it is null, it calls log.warn and returns without opening anything.
  • src/lib/components/update-banner.svelte: render Download only when updateStatus.canDownload, and keep Later in every case. Update the doc at 2-7.
  • src/tests/stores/update-status.test.ts:
    • drop the RELEASES_URL import;
    • add download_url to fireUpdate, to the default mockInvoke payload, and to the mockResolvedValueOnce payload 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".
  • New file src/tests/components/update-banner.test.ts. Follow src/tests/components/status-bar.test.ts for the render setup and the store test for the mocks, and set updateStatus fields 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

Coordination

#3320 depends on this issue. It:

  • reuses status_from in its check_for_update_with;
  • returns RELEASES_PAGE_URL as BuiltinUpdateSource's download URL for the public source, and None for the Pro arm;
  • adds no download_url field of its own, and has no RELEASES_URL fallback.

Steps

  1. Run the CLAUDE.md startup sequence with worktree issue-<N>-update-download-url:
    • git pull origin main;
    • EnterWorktree;
    • bun install;
    • a bun run test baseline;
    • bun run gh:assign <N> "@me";
    • bun run gh:status <N> "In Progress".
  2. Rust: the payload field, the helper and their tests.
  3. Frontend: the store, the banner and their tests.
  4. Run bun run scripts/check-pro-boundary.ts and paste the printed BASELINES.
  5. 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

  • UpdateStatus serializes download_url. The public source sets it to the releases page when there is an update, and no_update leaves 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/src returns 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.ts passes, with BASELINES lowered to the printed counts. Expected: proWording −1, from the deleted RELEASES_URL comment. New code adds no marker line.

Tests and verification

  • cargo test --lib -p nodespace-app update_check
  • NODESPACE_PRO_SUPABASE_URL=https://example.invalid NODESPACE_PRO_ANON_KEY=dummy cargo check -p nodespace-app
  • cargo clippy -p nodespace-app --all-targets -- -D warnings -D clippy::unused-async
  • bun run --cwd packages/desktop-app test src/tests/stores/update-status.test.ts src/tests/components/update-banner.test.ts
  • bun run test:changed
  • Mutation-check each new test.

Dependencies

Risks and rollback


Plan key: C4.3 (pro-boundary DAG).

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Sep 30, 2026
  2. added
    pro-boundary
    on Sep 30, 2026
  3. added 3 commits that reference this issue on Sep 30, 2026
    c2606e1
    e768b0b
    8d29e48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

pro-boundary

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions