Skip to content

Develop#64

Merged
altaskur merged 5 commits intomainfrom
develop
Feb 11, 2026
Merged

Develop#64
altaskur merged 5 commits intomainfrom
develop

Conversation

@altaskur
Copy link
Copy Markdown
Owner

Description

This PR migrates the autoCheckUpdates preference from localStorage to the database and implements full semver 2.0 comparison with prerelease support, fixing version update detection for alpha releases.

Goal

  • Fix update detection system to recognize alpha version increments (e.g., alpha.7 > alpha.6)
  • Migrate autoCheckUpdates preference to database for consistency with app architecture
  • Ensure SonarQube quality gate compliance and maintain high test coverage

Key Changes

  • Added autoCheckUpdates field to AppSettings schema with Prisma migration
  • Implemented full semver 2.0 version comparison with prerelease support (alpha, beta, rc)
  • Created IPC handlers for autoCheckUpdates with comprehensive test coverage (92%)
  • Migrated Angular UpdateService from localStorage to database calls
  • Refactored UpdateService to eliminate async constructor operation (SonarQube requirement)
  • Updated all test suites for new async initialization pattern
  • Added 50+ new test cases for semver prerelease comparison logic

Type of Change

  • 🐛 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
  • 🎨 Style/UI changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvement
  • ✅ Test updates
  • 🔧 Build/configuration changes

Impact Assessment

Database Impact

  • No database changes
  • New migration(s) included
  • Existing data migration required

Migration Details:

  • Added autoCheckUpdates boolean field to AppSettings table
  • Defaults to true for new installations
  • Existing users will see default value (no data migration from localStorage)

Backup Impact

  • No impact on backups
  • Backup format changed
  • Restore compatibility maintained

Impact Details:

  • Database backups now include autoCheckUpdates preference
  • Backup/restore functionality maintains full compatibility
  • Setting will be preserved across backup/restore operations

Testing

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing
  • Tested with SonarQube analysis

Test Results:

  • Electron tests: 399 passed
  • Angular tests: 814 passed
  • Total: 1,213 tests passing
  • Coverage: Angular 93.9%, Electron 63.45%, new code 92-100%
  • SonarQube: Quality Gate PASSED

Test Steps

  1. Install dependencies and run migrations: npm install + npx prisma migrate dev
  2. Run all tests: npm run test:electron and npm test
  3. Run SonarQube analysis: npm run sonar:check
  4. Start dev server: npm run dev
  5. Test update check functionality in app settings
  6. Verify autoCheckUpdates preference persists after app restart

Test Configuration

  • Node version: 20.x
  • npm version: 10.x
  • Platform tested: Windows

UI Changes

No UI changes included in this PR. Functionality remains the same from user perspective.

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • 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 run npm run lint and fixed any issues
  • I have run npm test and all tests pass
  • I have run npm run test:electron and all tests pass
  • I have run npm run sonar:check and the analysis passes
  • Any dependent changes have been merged and published

Breaking Changes

  • This PR contains breaking changes

No breaking changes. The migration is backward compatible.

Related Issues

Related to previous SmartScreen fix (PR #61)

Additional Context

Key Implementation Details:

  1. Semver Comparison: Implemented parseVersion() and comparePrereleases() helpers that fully support semver 2.0 specification with proper precedence: release > rc > beta > alpha

  2. Database Migration: Created Prisma migration 20260211084714_add_auto_check_updates_to_app_settings with proper defaults and updated template.db

  3. IPC Architecture: New handlers in auto-check-updates-handlers.ts with comprehensive error handling and fallback to true on errors

  4. SonarQube Compliance: Refactored UpdateService to avoid async operations in constructor, using explicit init() method pattern

  5. Test Coverage: Added extensive test coverage for:

    • Prerelease version comparisons (alpha.7 > alpha.6, beta > alpha, etc.)
    • IPC handler database operations
    • Angular service async initialization
    • Error handling and fallback scenarios

Reviewer Notes

Please pay special attention to:

  • Semver comparison logic in electron/src/services/update/update.service.ts
  • Database migration file and schema changes
  • IPC handler implementation and error handling
  • UpdateService async initialization pattern (constructor vs init())

All quality gates passed: 1,213 tests, 93.9% Angular coverage, SonarQube quality gate PASSED.

update develop v1.0.0-alpha.6
…e support

- Add autoCheckUpdates field to AppSettings schema with Prisma migration
- Implement full semver 2.0 comparison with prerelease support (alpha, beta, rc)
- Create IPC handlers for autoCheckUpdates with comprehensive test coverage (92%)
- Migrate Angular UpdateService from localStorage to database
- Refactor UpdateService to remove async constructor operation (SonarQube compliance)
- Update all tests for new async initialization pattern
- Coverage: Angular 93.9%, Electron 63.45%, new code 92-100%
- Quality gate: PASSED (1213 tests passing)
…gration

feat: migrate autoCheckUpdates to database with full semver prereleas…
@altaskur altaskur merged commit c882d34 into main Feb 11, 2026
1 check passed
@sonarqubecloud
Copy link
Copy Markdown

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