-
-
Notifications
You must be signed in to change notification settings - Fork 451
feat: track installation outcome to improve pending install state #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
6d309d5
610b252
6c443c9
a482aec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ import zed.rainxch.core.domain.repository.InstalledAppsRepository | |
| import zed.rainxch.core.domain.repository.SeenReposRepository | ||
| import zed.rainxch.core.domain.repository.StarredRepository | ||
| import zed.rainxch.core.domain.repository.TweaksRepository | ||
| import zed.rainxch.core.domain.system.InstallOutcome | ||
| import zed.rainxch.core.domain.system.Installer | ||
| import zed.rainxch.core.domain.system.PackageMonitor | ||
| import zed.rainxch.core.domain.use_cases.SyncInstalledAppsUseCase | ||
|
|
@@ -1192,7 +1193,7 @@ class DetailsViewModel( | |
| } | ||
| } | ||
|
|
||
| installer.install(filePath, ext) | ||
| val installOutcome = installer.install(filePath, ext) | ||
|
|
||
| // Launch attestation check asynchronously (non-blocking) | ||
| launchAttestationCheck(filePath) | ||
|
|
@@ -1205,6 +1206,7 @@ class DetailsViewModel( | |
| releaseTag = releaseTag, | ||
| isUpdate = isUpdate, | ||
| filePath = filePath, | ||
| installOutcome = installOutcome, | ||
| ) | ||
| } else { | ||
| viewModelScope.launch { | ||
|
|
@@ -1394,6 +1396,7 @@ class DetailsViewModel( | |
| releaseTag: String, | ||
| isUpdate: Boolean, | ||
| filePath: String, | ||
| installOutcome: InstallOutcome = InstallOutcome.DELEGATED_TO_SYSTEM, | ||
| ) { | ||
| try { | ||
| val repo = _state.value.repository ?: return | ||
|
|
@@ -1455,7 +1458,7 @@ class DetailsViewModel( | |
| releaseNotes = "", | ||
| systemArchitecture = installer.detectSystemArchitecture().name, | ||
| fileExtension = assetName.substringAfterLast('.', ""), | ||
| isPendingInstall = true, | ||
| isPendingInstall = installOutcome != InstallOutcome.COMPLETED, | ||
| installedVersionName = apkInfo.versionName, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== updateAppVersion declarations / implementations ==="
fd 'InstalledAppsRepository.*\.kt$' | while read -r file; do
echo "--- $file ---"
rg -n -C4 '\bupdateAppVersion\s*\(' "$file"
done
echo
echo "=== pending-flag writes near repository methods ==="
fd 'InstalledAppsRepository.*\.kt$' | while read -r file; do
echo "--- $file ---"
rg -n -C4 'isPendingInstall|updatePendingStatus' "$file"
done
echo
echo "=== package receiver handling ==="
fd 'PackageEventReceiver\.kt$' | while read -r file; do
echo "--- $file ---"
rg -n -C4 'updateAppVersion|updatePendingStatus|isPendingInstall' "$file"
doneRepository: OpenHub-Store/GitHub-Store Length of output: 4300 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Full updateAppVersion implementation ==="
rg -n -A 20 'override suspend fun updateAppVersion' core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.kt
echo
echo "=== DetailsViewModel update branch around insertOrUpdateApp ==="
rg -n -B 5 -A 15 'updateAppVersion' feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt | head -80
echo
echo "=== DetailsViewModel insert branch for comparison ==="
rg -n -B 5 -A 15 'insertApp\|isPendingInstall.*=' feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt | head -100Repository: OpenHub-Store/GitHub-Store Length of output: 1949 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Full updateAppVersion implementation (lines 181-240) ==="
sed -n '181,240p' core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.kt
echo
echo "=== DetailsViewModel isPendingInstall assignments ==="
rg -n 'isPendingInstall\s*=' feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt
echo
echo "=== DetailsViewModel updatePendingStatus calls ==="
rg -n 'updatePendingStatus' feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt
echo
echo "=== Complete insert branch in DetailsViewModel (lines 1433-1465) ==="
sed -n '1433,1465p' feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.ktRepository: OpenHub-Store/GitHub-Store Length of output: 4514 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Context around updatePendingStatus call at line 272 ==="
sed -n '260,285p' feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt
echo
echo "=== Check if there's a pending status write between updateAppVersion call and end of update branch ==="
sed -n '1423,1480p' feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.ktRepository: OpenHub-Store/GitHub-Store Length of output: 4248 Update path does not set pending status for delegated installs. The insert branch correctly sets Either add a 🤖 Prompt for AI Agents |
||
| installedVersionCode = apkInfo.versionCode, | ||
| latestVersionName = apkInfo.versionName, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return
COMPLETEDfor the synchronous desktop paths.This now always reports
DELEGATED_TO_SYSTEM, but several branches finish beforeinstall(...)returns:installAppImage(), successfulinstallDebPackage()/installRpmPackage()runs, and the successful.pkgflow that waits forinstaller. Any caller that relies onInstallOutcomewill misclassify those installs as pending. Thread the outcome back from the platform helpers instead of hard-coding it here.🤖 Prompt for AI Agents