Repository navigation
Carry the download URL in the update-check payload instead of a hardcoded releases page - #3387
Conversation
Pragmatic code review — Initial Review (medium effort)Independent reviewer agent (read-only, ran only the two frontend test files; no cargo per shared-machine constraint). Reviewed at head Recommendation: APPROVE (no critical or important findings; four optional suggestions). Requirements check (issue #3319)
Findings🔴 Critical: none. 🟢 Suggestions
Verified independently by the reviewer
|
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment, since GitHub blocks self-approval). Full findings in the review comment above.
b46be96 to
80257ff
Compare
Address-review summaryReviewed head was Addressed (1 of 4)
Skipped (3 of 4), with reasons
Other changes since the review
Verification on the pre-conflict rebased head (
|
The update banner's Download button opened a hard-coded releases page whatever source found the update. The Rust UpdateStatus now carries download_url, set by the source that found the update (null when there is no update or the source names no location), and the banner opens that URL and hides Download when there is none. RELEASES_URL is deleted. - update_check.rs: RELEASES_PAGE_URL for the public source, download_url on UpdateStatus, status_from() holding the version comparison. - update-status store: downloadUrl state, canDownload getter, download() is a no-op with a warning when there is no URL. - update-banner: Download only when canDownload; Later always. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…pened The download location is now data from the update source, and openUrl throws on anything that is not http(s). download() catches that and logs a warning, so a bad location no longer becomes an unhandled rejection from the banner's Download click. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
80257ff to
1b4f2b4
Compare
Closes #3319
The update banner's Download button always opened core's GitHub releases page, whatever source found the update. The update-check payload now carries the download location, the banner opens it, and Download is hidden when the source names none.
What changed
Rust (
packages/desktop-app/app-lib/src/update_check.rs)UpdateStatusgainsdownload_url: Option<String>(serializes asdownload_url,nullwhen absent).RELEASES_PAGE_URLfor the public source, next toLATEST_RELEASE_URL.status_from(current, latest, download_url)holds the version comparison. An update carries the source's URL; no update carriesNoneeven when the source has one.no_updatesetsNone.check_for_updatepassesSome(RELEASES_PAGE_URL)on the public-source branch andNoneon the other. The branch itself stays (the follow-on issues move and then delete it).Frontend
update-status.svelte.ts:RELEASES_URLand its comment are deleted.download_url: string | nullon the payload interface,downloadUrlstate set inapply()asstatus.download_url ?? null, acanDownloadgetter.download()opensdownloadUrl; with none it logs a warning and opens nothing.update-banner.svelte: Download renders only whencanDownload; Later renders in every case.Deviations from the issue text
packages/desktop-app/app-lib/src/update_check.rsand the tests run with-p nodespace-app-lib(the issue sayssrc-tauri/nodespace-app).download_url_serializes_as_a_key_that_is_null_when_absent) so the wire shape the frontend reads is pinned. On the frontend, beyond the two store tests and the two banner assertions the issue names: a store test that a payload omittingdownload_urlcounts as none (the issue's "missing field is null" risk note), one that a later payload without a URL clears an earlier one, a banner click test that Download opens the named URL, and a banner test that nothing renders when no update is available.check_for_updatesaid "the comparison and the surfaced banner are identical" for both sources. That is no longer true, so it now says only the download location differs. No Pro wording added.Ratchet (
scripts/check-pro-boundary.ts)Rebased onto main with the ratchet in it. Change vs
origin/main:proWording294 -> 293 (-1, the deletedRELEASES_URLcomment "both free and Pro releases are published here"). No other marker moves, and no added line carries a marker. I loweredBASELINES.proWordingto 293. I did not touchcloudSyncHooks: the check reports it at 0 against a baseline of 4, but that drop comes from an earlier merge, not from this change, so tightening it here would only risk a merge-queue conflict with whichever PR does it. No raise class applies.Verification
cargo clippy -p nodespace-app-lib --all-targets -- -D warnings -D clippy::unused-async: clean.cargo test -p nodespace-app-lib --lib update_check: 14 passed.bun run --cwd packages/desktop-app test src/tests/stores/update-status.test.ts src/tests/components/update-banner.test.ts: 14 passed.bun run --cwd packages/desktop-app quality:fix(eslint, design tokens, svelte-check): 0 errors, 0 warnings.bun run scripts/check-pro-boundary.ts: passes (proWording293 / 293).bun run test:changed(this diff against main): frontend 5363 passed, scripts 969 passed, browser 136 passed, Rust workspace 4100 passed plus 237 app-lib unit tests passed.rg -n -F -e RELEASES_URL -e 'both free and Pro' packages/desktop-app/src: no matches.Mutation checks (fix reverted, new test confirmed to fail)
Frontend: banner always renders Download (banner test fails);
download()without the null guard (2 store tests fail);applywithout?? null(omitted-field test fails);applynever setsdownloadUrl(3 store tests fail);download()opens a hard-coded URL (store test and banner click test fail); banner hides Later when there is no URL (banner test fails).Rust (each fails the named tests, then the file is restored):
no_update_carries_no_download_url_even_when_the_source_has_onean_update_carries_its_sources_download_url,download_url_serializes_as_a_key_that_is_null_when_absentno_updatesets a URL:no_update_status_is_current_only,no_update_carries_no_download_url_even_when_the_source_has_one,download_url_serializes_as_a_key_that_is_null_when_absentNoneURL:download_url_serializes_as_a_key_that_is_null_when_absentan_update_from_a_source_without_a_download_url_has_noneNot unit-testable: which URL
check_for_updatepasses on each branch. That is the thin network shell aroundstatus_fromand is unchanged in shape.Risks
🤖 Generated with Claude Code