Skip to content

feat(update): add manual release checking - #313

Open
arhxam wants to merge 2 commits into
getopenscreen:mainfrom
arhxam:codex/manual-release-checking
Open

feat(update): add manual release checking#313
arhxam wants to merge 2 commits into
getopenscreen:mainfrom
arhxam:codex/manual-release-checking

Conversation

@arhxam

@arhxam arhxam commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a localized Check for Updates action to the idle system-tray menu
  • query GitHub's official latest-stable-release endpoint with a 10-second timeout
  • compare installed/latest versions with semantic-version and prerelease ordering
  • report up-to-date, available, and failure states in native dialogs
  • open the exact official getopenscreen/openscreen release-tag page only after explicit user confirmation

This is intentionally the safe manual-checking slice of #301. It does not download, install, execute, or automatically poll for updates; automatic update policy/settings remain future work.

Related issue

Part of #301

Type of change

  • Bug fix
  • Feature
  • Enhancement
  • Documentation
  • Refactor / maintenance
  • Performance
  • Security

Release impact

  • Patch
  • Minor
  • Major / breaking change
  • No release note needed

Desktop impact

  • Windows
  • macOS
  • Linux
  • Installer / packaging
  • Not platform-specific

Screenshots / video

Not included; this adds a native tray item and native result dialogs.

Testing

  • Started with a failing updater-service test before the implementation existed
  • npx vitest --run electron/update-checker.test.ts (5 passed)
    • stable/prerelease semantic ordering
    • newer and installed-newer results
    • malformed/error responses
    • untrusted release URL rejection
  • npm run test (1,682 passed, 1 skipped across 141 files)
  • npx tsc --noEmit
  • npx tsc -p tsconfig.test.json --noEmit
  • npx biome check on the Electron, updater, test, and locale files
  • npm run docs:check
  • npm run i18n:check
  • npm run build-vite
  • Queried the live official releases API; it returned stable v1.9.0 and https://github.com/getopenscreen/openscreen/releases/tag/v1.9.0, matching the guarded contract

Authored with Codex assistance and manually security-reviewed to ensure this path cannot open a non-official download URL.

Summary by CodeRabbit

  • New Features
    • Added a “Check for Updates” option to the app’s tray menu.
    • The app now checks for newer releases and clearly indicates whether an update is available, the app is current, or the check could not be completed.
    • Added an option to open the official release page when an update is available.
  • Localization
    • Added update-related messages in Arabic, Chinese, English, French, German? Wait German absent. Don't mention German. Spanish, Italian, Japanese, Korean, Portuguese, Russian, Turkish, and Vietnamese.

@arhxam
arhxam requested a review from EtienneLescot as a code owner August 8, 2026 18:41
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@arhxam, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d75285e-2495-4685-af5f-ca5077780843

📥 Commits

Reviewing files that changed from the base of the PR and between fb521e9 and 0250f1d.

📒 Files selected for processing (3)
  • electron/update-checker.test.ts
  • electron/update-checker.ts
  • src/i18n/locales/vi/common.json
📝 Walkthrough

Walkthrough

The Electron app now checks the latest official GitHub release, compares semantic versions, displays localized update results, opens validated release links, and exposes the action in the tray menu. Tests cover version ordering, response validation, URL security, and failure handling.

Changes

Update checking

Layer / File(s) Summary
Version and release validation
electron/update-checker.ts
Adds semantic-version parsing and comparison, strict official release URL validation, and the UpdateCheckResult contract.
Latest release checking
electron/update-checker.ts
Fetches the latest GitHub release, applies required headers, supports cancellation, rejects invalid responses, and returns current or available results.
Update checker tests
electron/update-checker.test.ts
Covers version ordering, release availability, current versions, URL validation, failed responses, and malformed payloads.
Electron update workflow
electron/main.ts
Adds timeout-controlled serialized checking, localized dialogs, release-link navigation, failure handling, and a tray-menu action.
Localized update messages
src/i18n/locales/*/common.json
Adds update actions and status messages for all supported locales.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TrayMenu
  participant ElectronMain
  participant UpdateChecker
  participant GitHub
  participant Dialog
  TrayMenu->>ElectronMain: invoke Check for Updates
  ElectronMain->>UpdateChecker: checkLatestRelease(currentVersion, signal)
  UpdateChecker->>GitHub: request latest release
  GitHub-->>UpdateChecker: release response
  UpdateChecker-->>ElectronMain: current or available result
  ElectronMain->>Dialog: show localized update status
  ElectronMain->>Dialog: open validated release link when selected
Loading

Suggested reviewers: etiennelescot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the required summary, issue reference, change types, release and desktop impact, screenshots rationale, and testing details.
Title check ✅ Passed The title clearly and concisely describes the main change: adding manual release checking to the update feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@arhxam

arhxam commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

The earlier automated review was rate-limited; requesting a fresh substantive review now that the cooldown has elapsed.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

@arhxam I will perform a fresh substantive review of #313.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@electron/update-checker.test.ts`:
- Around line 46-88: Expand the update-checker tests around checkLatestRelease
to cover equal-version results, forwarding an AbortSignal to fetchLatest,
rejection of draft and prerelease releases, and rejection of GitHub URLs with
invalid paths, tags, queries, or hashes. Keep each case in
electron/update-checker.test.ts and assert the documented result or error for
every validation and cancellation contract.

In `@electron/update-checker.ts`:
- Around line 26-39: Update parseVersion to store major, minor, and patch as
bigint values, and build normalized core identifiers from the original validated
numeric components without precision loss. Reject leading-zero core identifiers
while preserving valid zero values, and add boundary tests covering oversized
identifiers and leading-zero inputs.

In `@src/i18n/locales/vi/common.json`:
- Around line 42-46: Update the Vietnamese `updates.current` translation to
state that the installed OpenScreen version is the latest/current version,
rather than saying OpenScreen has been updated; preserve the existing
`{{currentVersion}}` placeholder.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ef3436bb-9ad0-4117-a312-c8051b845b0e

📥 Commits

Reviewing files that changed from the base of the PR and between 4e7a85b and fb521e9.

📒 Files selected for processing (16)
  • electron/main.ts
  • electron/update-checker.test.ts
  • electron/update-checker.ts
  • src/i18n/locales/ar/common.json
  • src/i18n/locales/en/common.json
  • src/i18n/locales/es/common.json
  • src/i18n/locales/fr/common.json
  • src/i18n/locales/it/common.json
  • src/i18n/locales/ja-JP/common.json
  • src/i18n/locales/ko-KR/common.json
  • src/i18n/locales/pt-BR/common.json
  • src/i18n/locales/ru/common.json
  • src/i18n/locales/tr/common.json
  • src/i18n/locales/vi/common.json
  • src/i18n/locales/zh-CN/common.json
  • src/i18n/locales/zh-TW/common.json

Comment thread electron/update-checker.test.ts
Comment thread electron/update-checker.ts
Comment thread src/i18n/locales/vi/common.json
@arhxam

arhxam commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all three fresh review findings in 0250f1d: added the missing release-check behavior matrix, switched core SemVer identifiers to precision-safe bigint with leading-zero validation, and corrected the Vietnamese current-version wording. Biome format/check and git diff --check pass; exact-head CI is running.

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