Skip to content

Feat/skip update version#568

Merged
rainxchzed merged 3 commits into
mainfrom
feat/skip-update-version
May 11, 2026
Merged

Feat/skip update version#568
rainxchzed merged 3 commits into
mainfrom
feat/skip-update-version

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented May 11, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved update availability tracking when manually installing an older version of an app. The system now correctly maintains awareness of newer versions available for future updates, rather than clearing this information during the installation process.
  • Chores

    • Code quality improvements including reformatting, import organization, and database schema updates.

Review Change Stack

updateAppVersion was stamping latest* fields to the picked tag, so an
explicit older-version install (Details → pick older release → Install)
made installedVersionCode == latestVersionCode. The checkForUpdates
versionCode-parity canary then forced isUpdateAvailable = false forever
and the apps row claimed 'latest installed'. Recompute the flag against
the existing upstream snapshot instead and leave latest* untouched so
the next periodic check resolves the true latest from the feed.
@rainxchzed rainxchzed merged commit 716a999 into main May 11, 2026
1 check was pending
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 087685a1-e11b-4209-8a8e-cebf48ad0ac4

📥 Commits

Reviewing files that changed from the base of the PR and between 8b3cf45 and 9752c02.

📒 Files selected for processing (4)
  • composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/AppNavigation.kt
  • composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/whatsnew/WhatsNewLoaderImpl.kt
  • core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/16.json
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.kt

Walkthrough

The PR updates app version installation logic to preserve the "update pending" state when users install older releases. It adds database schema v16, refactors version state preservation in InstalledAppsRepositoryImpl.updateAppVersion() to recompute isUpdateAvailable rather than unconditionally clearing it, and includes minor code formatting cleanups.

Changes

App Version Update State Preservation

Layer / File(s) Summary
Database Schema v16
core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/16.json
Room schema snapshot for database version 16 (identityHash: f5ed61fb4d518930ffae62ab7c68f9f2) defines all tables and their columns, including installed_apps and update_history, with setup queries for room_master_table initialization.
App Version State Preservation
core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.kt
updateAppVersion now snapshots app.latestVersion and recomputes isUpdateAvailable by comparing the snapshot against newTag, preserving pending-update state when installing older releases. Cached latest* fields are no longer overwritten, preventing cache pollution in subsequent checks.
Code Formatting & Imports
composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/whatsnew/WhatsNewLoaderImpl.kt, composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/AppNavigation.kt
WhatsNewLoaderImpl.forVersionCode reformatted from single-line to multiline block; candidatePaths language tuple computation reformatted for clarity. AppNavigation.kt imports reordered alphabetically (AutoSuggestMirrorSheet before SkippedUpdatesRoot). No functional changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • OpenHub-Store/GitHub-Store#522: Both PRs modify InstalledAppsRepositoryImpl's update/availability logic; main PR changes updateAppVersion to preserve pending state, while the related PR adjusts checkForUpdates/backfill to avoid false self-update prompts.
  • OpenHub-Store/GitHub-Store#454: Both PRs touch installed-app update logic—specifically recomputing/preserving isUpdateAvailable in InstalledAppsRepositoryImpl when installing/updating versions.
  • OpenHub-Store/GitHub-Store#142: Main PR changes how InstalledAppsRepositoryImpl preserves/recomputes isUpdateAvailable on install, which directly affects the SearchViewModel logic in the related PR that relies on app.isUpdateAvailable.

Poem

🐰 The version keeper hops with glee,
No longer clears what pending be.
When old releases come to stay,
Update flags no longer fade away.
Schema v16 marks the path—
A rabbit's code, free from wrath! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/skip-update-version

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 and usage tips.

@rainxchzed rainxchzed deleted the feat/skip-update-version branch May 11, 2026 06:36
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