Repository navigation
Breaking changes
minSdkis now 23, required by Paging 3.5.1.compileSdkandtargetSdkare now 37, required by okhttp-android 5.5.0.retrofit-adapters-resultno longer exposesretrofit-adapters-serializationtransitively. If you usedeserializeHttpError, add the converter artifact you actually use.onFailureSuspendAsErrornow takes adeserializelambda as its first parameter, so it works with any json library:result.onFailureSuspendAsError({ it.deserializeHttpError<ErrorMessage>() }) { errorModel -> // handle the error model }ResultCallAdapterFactory.create()andEitherCallAdapterFactory.create()gained a second parameter, which changes their synthetic default-argument signature. Recompile against 1.2.0 rather than dropping the artifact into an existing build.
Fixes
retrofit-adapters-pagingwas broken in minified release builds. R8 renamed the private Retrofit call argument array the adapter reflects on, and shrank the@PagingKeyConfigmapper classes away entirely, so paging worked in debug and crashed in release. The module now ships consumer R8 rules, locates the argument array by type, and reads parameter annotations with java reflection, which also drops thekotlin-reflectdependency.EitherDeferredCallAdapterran the request insiderunBlocking, so the returnedDeferredwas already completed and the caller blocked on the network, and a transport failure escaped the adapter instead of completing as aLeft.CancellationExceptionwas swallowed byrunCatchingSuspend, bothenqueueimplementations, andNetworkPagingSource.load. Cancelled coroutines kept running, and a cancelled page load surfaced as a Paging error state.execute()now encapsulates transport failures the wayenqueue()already did.deserializeHttpErrorignores unknown keys, returns null rather than throwing on a malformed payload, and no longer consumes the error body on first read.- Restored ABI validation for the two Android library modules, which lost their
apiChecktasks when AGP 9 replaced thekotlin-androidplugin.
New
retrofit-adapters-moshiandretrofit-adapters-gson, alongside the existingretrofit-adapters-serialization, so you only pull in the json library you already use.retrofit-adapters-corewithThrowable.httpErrorBody()andNullBodyException.retrofit-adapters-paging-compiler, a KSP processor that validates@PagingKeyConfigand@PagingKeyat compile time and generates a reflection free mapper registry:It reports a missing annotation, a non Int paging key, a non suspend method, aksp("com.github.skydoves:retrofit-adapters-paging-compiler:1.2.0")keySizeof zero or less, and a mapper that does not implementPagingMapper, cannot be instantiated, or whose type arguments do not match the returnedNetworkPagingSource.Either.onLeftSuspendAsError, matchingResult.onFailureSuspendAsError.nullBodyAsFailureon both adapter factories, reporting an unexpected null body as a failure instead of a successful null.
What's Changed
- Update dependencies to the latest versions by @skydoves in #39
- Harden the call adapters and make error deserialization pluggable by @skydoves in #40
- Prepare for release 1.2.0 by @skydoves in #41
Full Changelog: 1.1.0...1.2.0