Phase 2: core + data refactors (Either flip, createHttpClient scope, tests) → 0.0.9-alpha01
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. -
createHttpClientcaller-owned scope (ADR-011). Fixes the unmanaged-SupervisorJob leak. YallaClient Koin override viaAppQualifier.SDK_HTTP_CLIENT_SCOPE. - 6 preference-impl unit tests (60 tests) + HttpClient integration tests (6 tests).
-
@Serializable+@SerialNamepinned on 17 public wire-carried domain models (17 round-trip tests). -
GuestModeGuardwhitelist moves toNetworkConfig(non-breaking default). - 3xx →
DataError.Network.Clientmapping documented with ADR-012. -
coresemantic-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-alpha04 → 0.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 detektgreen locally -
./gradlew apiCheckgreen locally (withDEVELOPER_DIR+ CocoaPods) -
./gradlew :data:iosSimulatorArm64Test→ 111/111 green -
YallaClient ./gradlew :androidApp:assembleDebuggreen against mavenLocal'd0.0.9-alpha01-phase2-*snapshots (verified in each breaking task) -
PR CI lint green
Known carry-overs (from Phase 2 concerns)
-
OrderStatus/PaymentKind/Orderneed hand-writtenKSerializers to preserve string-ID wire contracts. -
safeApiCallswallowsHttpRequestTimeoutExceptionvia itsIOExceptioncatch — timeout is mapped toConnectionfor Ktor's built-in timeout.SocketTimeoutExceptioncorrectly maps toTimeout. - Phase 3+ follow-ups documented in
docs/superpowers/plans/notes/2026-04-21-phase2-progress.md.