Skip to content

Update - #69

Merged
Rishabh4275 merged 8 commits into
mainfrom
update
Jun 17, 2025
Merged

Update#69
Rishabh4275 merged 8 commits into
mainfrom
update

Conversation

@Rishabh4275

@Rishabh4275 Rishabh4275 commented Jun 5, 2025

Copy link
Copy Markdown
Collaborator

Description

🚀 Feature: Comprehensive Auto-Update System

Overview

Implemented a complete auto-update system for the Cobolt application using electron-updater with GitHub releases. The system provides both automatic startup checks and manual update checking with a polished user interface.

✨ Features Added

🔄 Auto-Update Core (AppUpdater)

  • GitHub Integration: Automatically fetches updates from platinum-hill/cobolt repository
  • Startup Checks: Automatically checks for updates 3 seconds after app launch (packaged builds only)
  • Manual Updates: Menu-driven update checks with immediate feedback
  • Smart Download Management: Handles download progress, errors, and state management
  • Flexible Installation: Support for immediate installation or auto-install on next app quit

🎨 Update Notification UI (UpdateNotification)

  • Real-time Status: Live updates for checking, available, downloading, downloaded, and error states
  • Progress Tracking: Visual progress indicator during downloads
  • User Control: Options to download now, install immediately, or defer to next restart
  • Smart Dismissal: Remembers user dismissals per version to avoid notification spam
  • Responsive Design: Clean, modern notification popup with animations

🔧 Technical Implementation

Main Process Integration

// Automatic startup check (packaged apps only)
appUpdater?.checkForUpdatesOnStartup();

// IPC handlers for renderer communication
- 'check-for-updates-menu': Manual update checks
- 'download-and-install': Download management
- 'install-update': Immediate installation
- 'enable-auto-install': Deferred installation
- 'get-update-status': Status polling
- 'get-app-version': Version information

Renderer Process Integration

  • Event-driven architecture with proper cleanup
  • State management for update status and user preferences
  • Error handling with user-friendly messages
  • Accessibility features (proper button types, ARIA labels)

🎯 User Experience

Automatic Updates

  1. Silent Check: App checks for updates on startup without interrupting workflow
  2. Non-intrusive Notification: Appears only when updates are available
  3. User Choice: Never forces updates, always provides options

Manual Updates

  1. Menu Access: Available through application menu
  2. Immediate Feedback: Shows "checking" state instantly
  3. Clear Results: Displays "up to date" or available update information

Installation Flow

  1. Download Progress: Shows spinner for downloading.
  2. Installation Options:
    • Install now (restarts app)
    • Install on next restart (deferred)
    • Dismiss (can check again later)

🔒 Security & Reliability

  • Packaged App Only: Updates only work in production builds
  • Error Recovery: Graceful handling of network failures and corrupted downloads
  • State Consistency: Proper cleanup and state management
  • Memory Management: Timeout cleanup and event listener removal

Production Testing

  1. Create a GitHub release with version > current
  2. Build and package the app: npm run build && npm run dist
  3. Install the packaged app
  4. Launch - should automatically check for updates
  5. Use "Check for Updates" menu item for manual testing

📝 Configuration

The update system is configured to:

  • Check GitHub releases for platinum-hill/cobolt
  • Only run in packaged applications
  • Auto-download disabled (user confirmation required)
  • Auto-install on quit enabled (when user chooses deferred installation)

Fixes # (issue number)

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring (no functional changes)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Screenshots

If applicable, add screenshots to help explain your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested the app on Mac OS (If not, leave unchecked so we can test before merging)
  • I have tested the app on Windows (If not, leave unchecked so we can test before merging)
  • I have tested the app on Linux (If not, leave unchecked so we can test before merging)

@Rishabh4275
Rishabh4275 marked this pull request as draft June 5, 2025 06:28
@Rishabh4275
Rishabh4275 force-pushed the update branch 5 times, most recently from b6bf2cc to ba1fb7a Compare June 10, 2025 05:29
@Rishabh4275
Rishabh4275 marked this pull request as ready for review June 16, 2025 02:55
gauravagerwala
gauravagerwala previously approved these changes Jun 17, 2025

@gauravagerwala gauravagerwala left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this prompt the user to update without clicking on check for updates?

@Rishabh4275
Rishabh4275 merged commit e7eec56 into main Jun 17, 2025
2 checks passed
@Rishabh4275
Rishabh4275 deleted the update branch June 17, 2025 07:47
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.

2 participants