Skip to content

fix(apps): older-version install no longer pins row as up-to-date#567

Merged
rainxchzed merged 5 commits into
mainfrom
fix/install-older-version-poison
May 11, 2026
Merged

fix(apps): older-version install no longer pins row as up-to-date#567
rainxchzed merged 5 commits into
mainfrom
fix/install-older-version-poison

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented May 11, 2026

Three follow-ups missed by #559's merge:

  1. updateAppVersion no longer stamps latest* to the picked tag. Installing an explicitly older release (Details → pick → Install) was poisoning latestVersionCode, so the checkForUpdates versionCode-parity canary forced the update badge off forever. Now recomputes isUpdateAvailable against the existing upstream snapshot via VersionMath.isVersionNewer and leaves latest* for the next periodic check to resolve from the feed.
  2. Room schema 16.json — migration artifact for the column shipped in feat: skip-this-version per app (#542) #559, missing from main.
  3. ktlint cosmetic — import re-sort + multi-line params on two files.

Summary by CodeRabbit

  • Bug Fixes

    • Recalculated update availability after installs and stopped overwriting latest-version metadata when installing a release, preventing incorrect "up to date" states.
  • Chores

    • Minor code formatting and import reordering.
    • Added/updated database schema snapshot for migration to version 16.

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.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c5c272c1-eca5-4f45-ac19-ab1ea8b7e9e5

📥 Commits

Reviewing files that changed from the base of the PR and between 678ced7 and ad6a0d2.

📒 Files selected for processing (1)
  • feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/system/InstallationManagerImpl.kt

Walkthrough

Recomputes update availability when installing a tag (avoids stamping latest* metadata), adds a Room schema snapshot for DB version 16, changes first-install behavior to leave latest* fields null, and includes minor import/formatting edits.

Changes

Update Available Recalculation Fix

Layer / File(s) Summary
Database Schema Version 16
core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/16.json
Room schema snapshot for database version 16 with nine tables, indices, and room_master_table identity hash.
Update Availability Recalculation
core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.kt
updateAppVersion now recomputes isUpdateAvailable by comparing newTag against the existing app.latestVersion snapshot and persists that flag without overwriting latest* metadata.
First-install latest fields
feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/system/InstallationManagerImpl.kt
saveNewInstalledApp no longer pre-populates InstalledApp.latestVersion, latestAsset*, or latestVersionName/latestVersionCode on first install; those fields are initialized as null.

Formatting and Import Cleanup

Layer / File(s) Summary
Navigation Import Reordering
composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/AppNavigation.kt
Reorders imports for SkippedUpdatesRoot and AutoSuggestMirrorSheet only.
WhatsNewLoaderImpl Formatting
composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/whatsnew/WhatsNewLoaderImpl.kt
Reformats forVersionCode override and candidatePaths helper into multi-line/line-wrapped style without changing logic or language selection precedence.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through code with careful cheer,
I left the "latest" fields alone, not near—
When tags are picked and installs run,
Flags now match the truth, not just the fun. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main fix: preventing older-version installs from incorrectly marking apps as up-to-date.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/install-older-version-poison

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 merged commit 615a425 into main May 11, 2026
1 check passed
@rainxchzed rainxchzed deleted the fix/install-older-version-poison branch May 11, 2026 06:42
This was referenced May 11, 2026
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