VictorAlbertos / ReactiveCache

A reactive cache for Android and Java which honors the reactive chain.
Apache License 2.0
240 stars 24 forks source link

Feature useExpiredDataWhenNoLoaderAvailable() not working #12

Closed arkantos1482 closed 7 years ago

arkantos1482 commented 7 years ago

It doesn't make any change in the behavior of the ReactiveCache, whether you add useExpiredDataWhenNoLoaderAvailabe() or not. Whenever data expires, the record will be removed from both memory and disk. (regardless of using useExpiredDataWhenNoLoaderAvailabe())

The code: customerProvider = new ReactiveCache.Builder() .useExpiredDataWhenNoLoaderAvailable() .diskCacheSize(5) .using(context.getCacheDir(), new GsonSpeaker()) .provider() .lifeCache(15, TimeUnit.SECONDS) .withKey("CUSTOMER");

getCustomerApi.compose(customerProvider.readWithLoader());

armin-abbasi commented 7 years ago

Same issue here! Thanks for bringing it up!

VictorAlbertos commented 7 years ago

Here take a look I've just added two tests showing the useExpiredDataWhenNoLoaderAvailabe behaviour.

Next time please submit a test to expose what is the problem. Otherwise, I will close the issue right away. If you don't make the effort to narrow the "problem", I won't do it for you.