feat: support multiple installed apps per repository (monorepo)#480
feat: support multiple installed apps per repository (monorepo)#480rainxchzed wants to merge 1 commit intomainfrom
Conversation
After GitHub Store updates itself, Android does not deliver ACTION_PACKAGE_REPLACED to the app's own receivers, leaving isPendingInstall = true permanently in the database. Changes: - GithubStoreApp: registerSelfAsInstalledApp() now detects and resolves a stale isPendingInstall flag on every cold start by querying the system PackageManager. - PackageEventReceiver: handle ACTION_MY_PACKAGE_REPLACED (the Android-sanctioned broadcast for self-updates) with a fallback to context.packageName since it carries no data URI. - AndroidManifest: add a dedicated intent-filter for MY_PACKAGE_REPLACED (no data scheme required). Closes #478 Co-Authored-By: Oz <oz-agent@warp.dev>
|
Caution Review failedPull request was closed or merged during review WalkthroughThis PR adds support for multiple installed apps per repository to resolve self-update state persistence issues. It updates broadcast handling to detect self-updates, adds multi-app database queries, modifies repository logic to check all non-pending apps, and refactors presentation layers to select primary apps based on asset filters rather than assuming one-to-one repo-to-app mapping. ChangesMulti-App Installation Support
Sequence DiagramsequenceDiagram
participant System
participant PackageEventReceiver
participant GithubStoreApp
participant PackageMonitor
participant InstalledAppsRepository
participant InstalledAppDao
System->>PackageEventReceiver: Broadcast MY_PACKAGE_REPLACED
PackageEventReceiver->>PackageEventReceiver: Extract packageName from intent.data
PackageEventReceiver->>GithubStoreApp: onPackageInstalled(packageName)
GithubStoreApp->>InstalledAppsRepository: getAppByRepoId(self)
InstalledAppsRepository-->>GithubStoreApp: existing (with isPendingInstall=true)
GithubStoreApp->>PackageMonitor: Get current package info
PackageMonitor-->>GithubStoreApp: Package info (version, etc.)
GithubStoreApp->>InstalledAppDao: Update app (set isPendingInstall=false, refresh version)
InstalledAppDao->>InstalledAppDao: Persist to DB
InstalledAppDao-->>GithubStoreApp: Success
GithubStoreApp->>GithubStoreApp: Recalculate isUpdateAvailable
GithubStoreApp-->>System: State resolved
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
|
Reopening as a new PR from |
Summary
Remove the one-repo-to-one-app assumption that prevented installing and tracking multiple apps from the same GitHub repository.
Closes #471, Closes #420
Problem
Repos that ship multiple distinct apps in their releases (e.g.
ente-io/enteships Auth + Photos + Locker, Proton ships Mail + VPN + Drive) could only have one app tracked. Installing a second app from the same repo was blocked, and update checking only tracked the first installed asset.What Changed
Core layer (DAO + Repository):
getAppsByRepoId()andgetAppsByRepoIdAsFlow()list-returning queries toInstalledAppDaoalongside existing single-returning queriesInstalledAppsRepositoryinterface and implementationBadge/status across all screens:
associateBy { it.repoId }→groupBy { it.repoId }so installed/update badges reflect any tracked app per repoDetails screen:
installedApps: List<InstalledApp>toDetailsStateloadInitial()fetches all installed apps viagetAppsByRepoId()observeInstalledApp()usesgetAppsByRepoIdAsFlow(), picks primary byassetFilterRegexmatchWhat Already Worked (no changes needed)
checkForUpdatesper package name)packageName)packageName, notrepoId)Follow-up Work
installedApps.size > 1, listing each tracked appTest with
ente-io/ente(ships auth, photos, locker)AChep/keyguard-app(multiple APK variants)nicehash/NiceHashQuickMiner(multiple tools)Warp conversation
Implementation plan
Co-Authored-By: Oz oz-agent@warp.dev
Summary by CodeRabbit
Release Notes
New Features
Documentation