Skip to content

refactor(github): generalize property fetching, fix cancellation swallowing - #35

Merged
PonceGL merged 1 commit into
feature/downloadsfrom
chore/p9-generic-properties-fetch
Sep 11, 2026
Merged

PonceGL merged 1 commit into
feature/downloadsfrom
chore/p9-generic-properties-fetch

Conversation

@PonceGL

@PonceGL PonceGL commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Staged internally first (was chore/p9-generic-properties-fetch on PixelPlayerHQ#2828, closed — see that PR's closing comment). Will be proposed upstream again once the downloads feature it's part of is further along.

…te cancellation-test comment

code-review on PR #35 found four issues:

- fetchPlayStoreAnnouncement() used .mapCatching { it.toPlayStoreAnnouncementRemoteConfig() },
  which catches Throwable, not just Exception — silently turning a real
  bug or an OutOfMemoryError in that pure mapping into an ordinary
  Result.failure. The pre-refactor code built the config inside a
  catch (e: Exception) branch, so an Error would have propagated as
  intended. Switched to .map (non-catching), matching that behavior.

- The cancellation test's own comment claimed cancelling before the
  call starts 'exercises exactly' the
  catch (e: CancellationException) { throw e } inside fetchRawProperties
  — it doesn't: withContext's pre-flight ensureActive() throws before
  the function body runs, same issue found on PR #28's JellyfinApiService
  tests. Unlike that OkHttp case, HttpURLConnection has no interceptor
  seam to throw an exception mid-call, so there's currently no way to
  write a test that actually reaches this catch. Reworded the comment
  to say so plainly instead of claiming coverage it doesn't have.

- A third finding (HttpURLConnection is fundamentally not cancellable;
  the real fix is migrating to the app's injectable OkHttpClient) was
  already disclosed in this PR's own KDoc as an accepted, deferred
  limitation — left as-is, not re-litigated.

Verified: compiles, full JVM suite green (398 tests, same 5
pre-existing baseline failures as master, none new).
@PonceGL
PonceGL changed the base branch from main to feature/downloads September 11, 2026 15:01
@PonceGL
PonceGL merged commit c173a2a into feature/downloads Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant