refactor(core): harden exception safety, coroutine cancellation, and memory optimization - #580
Open
Himanth-reddy wants to merge 1 commit into
Open
Conversation
…iew fixes - PR #59: harden exception safety and json parsing in scraper & repository layers - PR #61: optimize memory by extracting regexes and harden json error handling - PR #62: harden exception safety, Trakt auth checks, and watch history cancellation - PR #63: preserve coroutine cancellation across sync, home server, and catalog layers - PR #64: propagate cancellation across viewmodels and UI components - PR #65: optimize stream parsing layers and source attribution regexes - PR #66: harden exception safety and edge-case validation in watchlist & network layers
Owner
|
Thanks for putting this cleanup together. The cancellation/error-handling work looks useful, and I verified that the exact merge compiles for both Play and Sideload and passes the Sideload unit tests. Before merging, could you please fix these two points:
After those two adjustments, this should be in good shape to merge. |
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.
Summary
This pull request consolidates and squashes core stability, exception safety, and coroutine cancellation refactor improvements across data repositories, viewmodels, and UI components.
Key Changes
runCatching/catch (e: Exception)blocks inCloudSyncRepository,HomeServerRepository,WatchHistoryRepository,HttpLocalScraperRuntime, andIptvPlaybackUrlResolverto ensureCancellationExceptionis rethrown correctly.DetailsViewModel,TvViewModel,LoginViewModel, andWatchlistViewModel.AuthRepositoryandCloudSyncRepositorywith diagnostic logging viaAppLogger.recordException.traktRepository.isAuthenticated.first()instead of triggering offline network refresh during startup profile evaluation.StreamSourceAttributionRegexes,AutoPlayRegexes) to reduce GC pressure and repeated allocations during stream resolution and source attribution.OkHttpProvider,WatchlistRepository, and stream resolution layers.Verification
./gradlew :app:compileSideloadDebugKotlin :app:testSideloadDebugUnitTestpassed successfully (BUILD SUCCESSFUL).