Skip to content

Phase 2: core + data refactors (Either flip, createHttpClient scope, tests) → 0.0.9-alpha01

Import User requested to merge feature/v1-phase2-core-data into main

Summary

Phase 2 of the v1.0 public-launch initiative. Pays down the largest debt in core + data:

  • Either<D, E>Either<E, D> (ADR-010). Error-first, ecosystem convention. 20 SDK call-sites + 139 YallaClient call-sites flipped in lockstep.
  • createHttpClient caller-owned scope (ADR-011). Fixes the unmanaged-SupervisorJob leak. YallaClient Koin override via AppQualifier.SDK_HTTP_CLIENT_SCOPE.
  • 6 preference-impl unit tests (60 tests) + HttpClient integration tests (6 tests).
  • @Serializable + @SerialName pinned on 17 public wire-carried domain models (17 round-trip tests).
  • GuestModeGuard whitelist moves to NetworkConfig (non-breaking default).
  • 3xx → DataError.Network.Client mapping documented with ADR-012.
  • core semantic-stability pass recorded — 36 declarations reviewed, 6 follow-ups flagged.
  • Either.getOrNull(), getOrThrow(), fold(…) additive extensions.
  • UnauthorizedSessionEvents.drainPendingEventIfExists() additive helper.

Version bumps from 0.0.8-alpha040.0.9-alpha01 to reflect the cumulative breaking surface.

Coordination

YallaClient lockstep on branch chore/sdk-phase2-either-flip (extends PR #304) targeting dev. Do not merge the YallaClient PR until this PR merges and 0.0.9-alpha01 publishes to GitHub Packages. After publish, update YallaClient's libs.versions.toml to pin the published version, drop mavenLocal(), rebase, merge to dev.

Test plan

  • ./gradlew ktlintCheck detekt green locally
  • ./gradlew apiCheck green locally (with DEVELOPER_DIR + CocoaPods)
  • ./gradlew :data:iosSimulatorArm64Test → 111/111 green
  • YallaClient ./gradlew :androidApp:assembleDebug green against mavenLocal'd 0.0.9-alpha01-phase2-* snapshots (verified in each breaking task)
  • PR CI lint green

Known carry-overs (from Phase 2 concerns)

  1. OrderStatus / PaymentKind / Order need hand-written KSerializers to preserve string-ID wire contracts.
  2. safeApiCall swallows HttpRequestTimeoutException via its IOException catch — timeout is mapped to Connection for Ktor's built-in timeout. SocketTimeoutException correctly maps to Timeout.
  3. Phase 3+ follow-ups documented in docs/superpowers/plans/notes/2026-04-21-phase2-progress.md.

🤖 Generated with Claude Code

Merge request reports

Loading