Repository navigation
feat(updates): allow opting out of automatic version checks - #847
Conversation
Add a shared global preference and environment override for automatic release checks and notifications. Keep explicit checks and upgrades available, including when cached results exist or a check finishes after opt-out. Expose the preference through the CLI and dashboard, and document the desktop app integration. Closes #846
Recheck the effective preference before publishing CLI and doctor results, and before starting another automatic request. Keep project doctor attached to the global config instead of freezing its initial policy in a subprocess. Hide cached doctor update notices without hiding diagnostic warnings, refresh version data when the external preference changes, and retain an explicit dashboard upgrade action. Localize manual-check failures. Add regressions for in-flight opt-out, buffered results and manual upgrades.
Keep automatic update suggestions distinct from diagnostic advice so a late opt-out removes their summary warnings and next steps without hiding unrelated fixes. Allow the explicitly requested Web upgrade simulation in development builds and cover both cases with regressions.
Notify Settings when the simulated upgrade closes so the user can open another explicitly requested upgrade without reloading the page.
Use the typed upgrade response fields in the explicit-dev-upgrade regression fixture.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 009085c0aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if err != nil { | ||
| return err |
There was a problem hiding this comment.
Preserve JSON output when update commands fail
When skillshare updates check --json encounters a network failure or GitHub rate limit, this branch returns the error without calling writeJSONError. Consequently, main.go prints a blank line and a human-readable error to stdout, breaking consumers expecting JSON. Route JSON-mode failures through the existing structured-error helper; the same issue affects argument validation, preference-save, preference-read, and unknown-action errors in this handler.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 678b1b6. The handler now detects --json before parsing and uses the existing writeJSONError boundary for all returned errors, covering unknown actions, argument validation (including a trailing --json), preference reads/saves, network failures and rate limits. Main receives jsonSilentError and exits 1 without appending text. TestUpdatesJSONFailures covers eight error scenarios; TestUpdates_JSONFailures verifies five real-binary cases with clean JSON stdout, empty stderr and exit 1. Plain-mode behavior is also covered. Targeted tests and full make check passed in the devcontainer; the corrective diff passed all five local review passes.
Detect --json before argument validation and route every updates failure through the shared JSON error boundary. Main can then exit nonzero without contaminating stdout with plain-text errors. Cover argument order, unknown actions, preference reads and saves, network failures and rate limits. Real-binary regressions verify JSON purity, silent stderr and exit status while preserving plain-mode behavior.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 678b1b6595
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {manualCheck.data.cliUpdateAvailable || manualCheck.data.skillUpdateAvailable | ||
| ? t('settings.updates.available', { cli: manualCheck.data.cliLatest ?? manualCheck.data.cliVersion, skill: manualCheck.data.skillLatest ?? manualCheck.data.skillVersion }) | ||
| : t('settings.updates.current')} |
There was a problem hiding this comment.
Distinguish a failed skill check from an up-to-date result
When the CLI is current and the release API succeeds but the built-in skill request fails, this branch reports “No newer version found” without determining whether the skill is current. FetchRemoteSkillVersion() returns an empty string on transport errors or non-200 responses, so handleVersionCheck returns success with skillLatest unset and skillUpdateAvailable: false. For an installed skill, distinguish that missing result from a successful check, either by showing a partial/check-failed status or propagating the manual-check failure.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ef3cdbb. The manual version API now returns HTTP 502 when the installed built-in skill's remote result is missing, including transport errors, non-200 responses and missing version metadata; automatic checks remain quiet. Settings prioritizes the error over retained query data, hiding both stale success notices and stale upgrade actions after a failed refetch. TestManualVersionCheckSkillResult covers all three failures and a genuinely current result in both global and project modes. Full make check, 883 Web tests and the Web build passed. A browser fixture verified success-then-failure cache handling and localized error rendering in Clean/Playful light/dark; all four screenshots were inspected. The three-file corrective diff passed five local review passes.
A successful release API request does not establish that the built-in skill is current when its separate request fails. Return a manual-check error for missing remote skill results, while retaining quiet automatic behavior. Prioritize the error over retained query data so failed refetches cannot display stale success notices or upgrade actions. Cover network, HTTP and missing-version failures plus verified-current results in global and project mode.
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Type
approvedlabel.Summary
skillshare updates on|offto save the global preference andupdates checkfor an explicit, uncached CLI version check.status,doctor, project mode and checks already in flight. Explicit checks and upgrades remain available.Linked Issue
Closes #846
Companion desktop PR: runkids/skillshare-app#126
Verification
make check, 883 Web tests, Web build, and the website build for all five locales passed in the devcontainer.updates check --jsonand explicit Web API check still reached the release endpoint with the preference disabled.ef3cdbb2c481e50322dfe442ba110feb0e0bf38d; the full Web suite/build and devcontainermake checkpassed, including the latest CLI corrective changes.678b1b659, covering all argument/read/save/network/rate-limit failures at one boundary. Eight unit failure scenarios and five real-binary cases verify clean JSON, empty stderr and exit 1; plain mode is unchanged. The corrective diff passed all five local review passes.ef3cdbb2c. Missing skill results now fail the manual API rather than imply all versions are current; refetch errors hide stale cached success/upgrade actions. Eight global/project API cases, fullmake check, 883 Web tests, the Web build, and four inspected localized theme screenshots passed. Five local review passes found no remaining issue in this corrective diff. Codex round 3 completed onef3cdbb2cwith no new findings.Merge Danger
Two-way, global preference only. Defaults remain enabled; environment overrides are process-local and are not written back. An open Web dashboard refreshes only the local policy every five seconds; desktop external changes refresh within a minute.
Checklist
make check)