Skip to content

Add auto-update support with electron-updater#42

Merged
0suu merged 2 commits into
mainfrom
suu/add-auto-update
Mar 24, 2026
Merged

Add auto-update support with electron-updater#42
0suu merged 2 commits into
mainfrom
suu/add-auto-update

Conversation

@0suu

@0suu 0suu commented Mar 24, 2026

Copy link
Copy Markdown
Owner
  • Add electron-updater dependency and configure GitHub as publish provider
  • Implement auto-update check/download/install flow in main process
  • Expose autoUpdater API via preload bridge
  • Add update notification UI (download progress bar, restart prompt)
  • Add "Check for updates" button in Settings screen
  • Add i18n translations (EN/JA) for update-related strings
  • Add release workflow for Windows/macOS builds on tag push
  • Clean up ci.yml by removing unused packaging steps and Linux target

- Add electron-updater dependency and configure GitHub as publish provider
- Implement auto-update check/download/install flow in main process
- Expose autoUpdater API via preload bridge
- Add update notification UI (download progress bar, restart prompt)
- Add "Check for updates" button in Settings screen
- Add i18n translations (EN/JA) for update-related strings
- Add release workflow for Windows/macOS builds on tag push
- Clean up ci.yml by removing unused packaging steps and Linux target

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@0suu

0suu commented Mar 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the application by introducing robust auto-update capabilities. By integrating electron-updater, the application can now seamlessly detect, download, and install new versions, greatly improving the user experience and simplifying maintenance. The changes include comprehensive backend logic for update management, a new API exposed to the frontend for interaction, and intuitive UI elements to keep users informed about the update process.

Highlights

  • Auto-Update Functionality: Integrated electron-updater to enable automatic application updates, ensuring users always have the latest version.
  • Main Process Update Logic: Implemented the core auto-update flow in the main process, handling update checks, downloads, and installation, with initial checks on app launch.
  • Renderer Process API Exposure: Exposed the autoUpdater API to the renderer process via a preload script, allowing the UI to interact with update events and actions.
  • User Interface for Updates: Added UI components to display update notifications, including download progress bars and a prompt to restart the application when an update is ready.
  • Manual Update Check: Introduced a 'Check for updates' button in the Settings screen, providing users with the option to manually initiate an update check.
  • Internationalization (i18n): Added new translation strings for all update-related messages in both English and Japanese.
  • Build Configuration Updates: Configured package.json to use GitHub as the publish provider for builds, added zip as a macOS build target, and removed the Linux build target.
  • Dependency Management: Updated package-lock.json to include electron-updater and its dependencies, along with adjustments to peer dependency flags for various packages.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/ci.yml
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 24, 2026

Copy link
Copy Markdown

Deploying switchbotcontroller with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9d84f9e
Status:⚡️  Build in progress...

View logs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces auto-update support using electron-updater, which is a great enhancement for the application. The implementation is comprehensive, covering the main process logic, preload script API exposure, and renderer UI for update notifications, download progress, and manual checks. The code is well-structured, particularly the event handling in both the main and renderer processes, which includes proper cleanup to prevent memory leaks. I've identified a couple of medium-severity issues: one concerning a deprecated transitive dependency and another related to an inconsistent method for checking the application environment, which could be improved for better robustness.

Comment thread src/main/main.ts Outdated
setupAutoUpdater(win);

// Check for updates after a short delay (skip in dev — app is not packaged)
if (process.env.NODE_ENV !== "development") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency and improved robustness, it's better to use app.isPackaged to determine if the application is running in a packaged environment. You are already using this method in the updater-check IPC handler. The process.env.NODE_ENV check might not be reliable across all build configurations, whereas app.isPackaged is the canonical way to perform this check in Electron.

Suggested change
if (process.env.NODE_ENV !== "development") {
if (app.isPackaged) {

Comment thread package-lock.json
Comment on lines +8039 to +8045
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
"deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.",
"license": "MIT"
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The lodash.isequal package, which is a transitive dependency of electron-updater, is deprecated. The deprecation message suggests using require('node:util').isDeepStrictEqual instead. While this is an issue in a dependency and not your direct code, it's good to be aware of it. You might consider checking if a newer version of electron-updater resolves this or monitoring for a fix.

@0suu

0suu commented Mar 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Replace process.env.NODE_ENV check with app.isPackaged to match
the existing pattern in the updater-check IPC handler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@0suu
0suu merged commit 4740793 into main Mar 24, 2026
1 of 2 checks passed
@0suu
0suu deleted the suu/add-auto-update branch March 24, 2026 10:51
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