Repository navigation
fix(test): keep SyncInstalledAppsUseCase on the test dispatcher - #4
Merged
Merged
Conversation
ViewModel tests were racing Dispatchers.IO resumes against resetMain(), which left UncaughtExceptionsBeforeTest on SearchViewModelTest in CI.
Locale LocalContext hid the Activity so bar updates never ran, and enableEdgeToEdge followed system night mode instead of the in-app theme.
Seed AppCompat night mode and theme state early so cold start no longer flashes light under a dark preference.
Send sort params to GitHub, tighten name-scope ranking after APK verification, and restyle the sort sheet as modal radio rows.
Survive leaving Details, show progress/complete notifications that deep link into the repo, and polish the Downloads list with repo metadata.
Reflect local APKs and Downloads installs on the Details button, skip re-download when the file exists, and use Download/Upgrade icons.
Document background downloads, search sort, theme flash fix, and install-state UI for the 1.4.1 release notes.
MainActivity offers the notification intent from onCreate, before Compose starts collecting, and DeepLinkHandler used a MutableSharedFlow with replay = 0. With no subscriber at that moment the emission was dropped, so tapping a download notification while the process was dead opened Home instead of the repo. Buffer the destination in a conflated Channel so a cold-start link survives until App.kt collects it. Covered by a new delivery test.
notifyProgress() and notifyComplete() return early unless canNotify() has verified POST_NOTIFICATIONS, but lint cannot see across methods and reports MissingPermission on manager.notify(). Suppress at the two call sites with the existing check documented.
install_downloaded and the four download-notification strings were English-only, breaking the established key parity. Add German, Spanish, French, Japanese, Russian and Chinese translations so all seven locales carry 286 keys. Fixes the five MissingTranslation lint errors.
…ications AndroidDownloader still requests VISIBILITY_HIDDEN when the app can show its own notification, but the manifest had dropped DOWNLOAD_WITHOUT_NOTIFICATION, which that visibility requires. Declare it again so DownloadManager does not fall back to its own notification and duplicate the app's.
getDownloadedFilePath() treated any existing non-empty file as downloaded, but DownloadManager writes into the destination while the transfer runs. At 80% the Details button switched to "Install downloaded", and tapping it handed a partial APK to the package installer (parse error). Track completion explicitly: DownloadManager status is the source of truth (plus a .complete marker for records that get pruned). getFileState() reports in-progress/complete/failed, and both Details and Downloads validate the APK before offering or launching install. Unfinished or corrupt files are removed instead of being surfaced. Downloads metadata now also carries the repo avatar URL, persisted in the sidecar next to repoId/displayName.
Replace the generic Android glyph with the repo avatar (falling back to the app icon) and keep the app/repo title above the .apk filename and size. The install action uses the System Update icon instead of the Android logo.
Use the filled download glyph so the small icon reads clearly at 24dp in the status bar and the notification shade.
Switching categories was ignored while any list was loading because loadRepos returned early on isLoading, and the chip only updates when the new load starts. Drop that guard, cancel the in-flight job, and guard state updates with a load generation so a late emission from the old category cannot overwrite the new one. New and Popular are now saved per category under cacheDir/home_cache with a 10-minute TTL. Page one emits the saved list immediately (and skips the network while it is fresh), then the live flow replaces it. Fresh cached data no longer shows the offline-only notice while online.
Downloads saved before avatar metadata existed fell back to the GitStore app icon, which looked like the wrong app. Backfill the avatar from the installed app row when the sidecar has none, and use the repo's initial as the final fallback instead of the launcher icon.
Trending still fetched jsDelivr before reading its disk copy, so a cold start could sit on "Finding repositories" for the whole request timeout even with a saved list available. Read the cache first, emit it, and only then refresh. Trending and the New/Popular cache now share the same shape: saved list first, network only when the entry is older than a day or the user taps Retry (forceRefresh). New/Popular move from a 10-minute to a 24-hour window so the daily data from the discovery bot is picked up once per day.
Legacy download sidecars have no avatar URL, so cards fell back to a single letter even though the repo avatar is available. Resolve it from the installed app row first, then derive https://github.com/<owner>.png from the saved "owner/repo" display name. Replace the ambiguous icon-only install action with a clear "Install" button.
New/Popular only wrote their cache after the whole probe finished. Because the probe emits in batches and is cancelled when you leave the tab, a normal visit often ended without a cache, so every return re-ran the expensive probing pass. Save after every verified batch (and at the end), so a tab is cached as soon as it shows its first three results. All three categories now share one offline rule: paint the saved list if there is one, otherwise emit the offline state. New/Popular no longer skip their cache when offline, and load-more stops instead of attempting a doomed request.
Verifies that a saved list survives serialization, keeps its repo fields, reads back for the same key, and is considered fresh immediately after writing.
Batch writes made the first three results look like a complete page for 24 hours. Track a `complete` flag: partial writes paint instantly but still run the probe, and only a finished page short-circuits the network. Verified on the signed-in release: New/Popular write after each batch and end with complete=true, and switching back serves the saved list without a probe.
Android's cache trim purged cacheDir/trending_apps.json mid-session, and the Home category cache lived there too, so saved lists could vanish between launches and every tab switch paid for a full probe. Move both stores to filesDir so saved lists survive system cache cleanup.
GitHub now serves the repository at Darkmintis/GitStore (no hyphen). Update the jsDelivr trending seed URL, the update-check API, the in-app repo/bug-report links, and the CONTRIBUTING/SECURITY links so nothing depends on a redirect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ViewModel tests were racing Dispatchers.IO resumes against resetMain(), which left UncaughtExceptionsBeforeTest on SearchViewModelTest in CI.
Description
Fixes the CI flake by keeping
SyncInstalledAppsUseCaseon the test dispatcher, then ships launch UX for v1.4.1: background downloads with tappable notifications, smarter search sort, install/downloaded state on Details, theme flash / status-bar contrast fixes, and updated release notes.Type of Change
Related Issue
N/A
Changes Made
SyncInstalledAppsUseCaseon the injected/test dispatcher so ViewModel tests no longer raceDispatchers.IOvsresetMain()gitstore://repo/{id}RELEASE_NOTES.mdfor the v1.4.1 launch UXTesting
Test Configuration:
Checklist
Additional Notes
Branch also includes:
DeepLinkHandlerTest,RankSearchResultsTest, and the earlier status-bar / test-dispatcher fixes. Push the 5 local launch-UX commits if origin is still behind.