fix(updates): scope auto-pick by tracked package flavor#570
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR scopes the resolver's platform auto-pick fallback by the tracked app's package flavor so the final fallback selection prefers assets matching the app's inferred flavor; a new flavor-filter helper performs token normalization and filtering, and localized release notes were updated. ChangesPackage Flavor-Scoped Asset Auto-Pick
Sequence Diagram(s)(omitted — change is a focused resolver/data-model tweak with no expanded multi-component runtime sequence beyond existing client/resolver/storage interactions) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/util/AssetVariant.kt`:
- Around line 489-495: package flavor tokens are taken verbatim from
packageSegments and compared against raw asset tokens, so alias forms (e.g.
"f-droid") are missed; change the packageFlavorTokens creation to
normalize/expand aliases before comparison (e.g., replace the current val
packageFlavorTokens = packageSegments.filter { it in FLAVOR_TOKENS }.toSet()
with logic that maps each matching package segment through the same
tokenization/normalization used by extractTokens and collects the resulting
tokens into a set), then keep the existing assets.filter { asset ->
extractTokens(asset.name).any { it in packageFlavorTokens } } check so
comparisons occur between normalized tokens.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 059cabb5-b3b1-41ce-af94-c497d51d7526
📒 Files selected for processing (15)
core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.ktcore/domain/src/commonMain/kotlin/zed/rainxch/core/domain/util/AssetVariant.ktcore/presentation/src/commonMain/composeResources/files/whatsnew/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ar/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/bn/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/es/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/fr/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/hi/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/it/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ja/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ko/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/pl/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ru/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/tr/17.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/17.json
Auto-update picker could swap a tracked stock package for an
.fdroidsibling APK that lives in the same release. System then installed<base>.fdroidas a new parallel app while the tracked row still pointed at the original — Apps screen snackbar said "updated" but the original package never moved.Fix: new
AssetVariant.filterByPackageFlavor(assets, trackedPackageName)helper. The update-check resolver narrows the auto-pick pool to assets whose filename flavor tokens match the tracked package's flavor segments (com.foo.bar→ drop fdroid/foss/play assets;com.foo.bar.fdroid→ keep them). Empty-filter guard returns the original set so we never lose the prompt.Pinned variants (token / glob / position) are untouched — they ran against the full installable set above the auto-pick. Other resolver behavior unchanged.
What's-new bullet × 13 locales.
Summary by CodeRabbit
Bug Fixes
Localization