title: Having trouble fetching data using android nytimes Store library
body: <p>I have the following code, that i'm trying to use to fetch data from an API endpoint using the NyTimes/Store library to cache it</p>
  
  <p>I'm using DI to load my dependencies as follows</p>
  
  <pre><code>  val appModule = module(override = true) {
          single&lt;MyAppDatabase&gt; {
              Room.databaseBuilder(androidApplication(), MyAppDatabase::class.java, "MJiraniRoomDB")
                  .fallbackToDestructiveMigration()
                  .build()
          }
          //DATABASE ACCESS OBJECTS
          factory&lt;BlogDao&gt; { get&lt;MyAppDatabase&gt;().blogDao() }
          factory&lt;BlogLocalService&gt; { BlogLocalService(get()) }
          factory&lt;BlogRemoteService&gt; { BlogRemoteService(get()) }
          factory&lt;BlogStore&gt; { BlogStore(get(), get()) }
  
  </code></pre>
  
  <p>The service where i use the Store library with RoomStore is here</p>
  
  <pre><code>package com.example.myapplication.service.BlogService
  
  import com.example.myapplication.model.Blog
  import com.nytimes.android.external.store3.base.Fetcher
  import com.nytimes.android.external.store3.base.impl.BarCode
  import com.nytimes.android.external.store3.base.impl.MemoryPolicy
  import com.nytimes.android.external.store3.base.impl.StalePolicy
  import com.nytimes.android.external.store3.base.impl.room.StoreRoom
  import com.nytimes.android.external.store3.base.room.RoomPersister
  import io.reactivex.Observable
  import java.util.concurrent.TimeUnit
  
  class BlogStore(val blogRemoteService: BlogRemoteService, val blogLocalService: BlogLocalService) {
  
      var fetcher = Fetcher&lt;List&lt;Blog&gt;, BarCode&gt; {
          blogRemoteService.fetchBlogs()
      }
  
      val persister = object : RoomPersister&lt;List&lt;Blog&gt;, List&lt;Blog&gt;, BarCode&gt; {
  
          override fun read(barCode: BarCode): Observable&lt;List&lt;Blog&gt;&gt; {
              return blogLocalService.fetchAll().toObservable()
          }
  
          override fun write(barCode: BarCode, blogList: List&lt;Blog&gt;) {
              blogLocalService.addBlogs(blogList)
          }
      }
  
      var memoryPolicy: MemoryPolicy = MemoryPolicy
          .builder()
          .setExpireAfterWrite(5)
          .setExpireAfterTimeUnit(TimeUnit.SECONDS)
          .build()
  
      var store = StoreRoom.from(fetcher, persister, StalePolicy.REFRESH_ON_STALE, memoryPolicy)
  
      fun getBlogs(): Observable&lt;List&lt;Blog&gt;&gt; {
          store.clear()
          return store.fetch(BarCode.empty())
      }
  }
  </code></pre>
  
  <p>I pull the data to my Recyclerview as follows</p>
  
  <pre><code>class RemotePostsFragment : Fragment() {
      val scopeProvider by lazy { AndroidLifecycleScopeProvider.from(this) }
  
      val myBlogStore: BlogStore by inject()
  
      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          super.onViewCreated(view, savedInstanceState)
  
          var mRecyclerview = view.findViewById&lt;RecyclerView&gt;(R.id.myRemoteViewRecycler)
  
  
          var theAdapter = MyAdapter()
         myBlogStore.getBlogs()
              .subscribeOn(Schedulers.io())
              .observeOn(AndroidSchedulers.mainThread())
              .autoDisposable(scopeProvider)
              .subscribe({ bloglist -&gt;
                  theAdapter.blogItems = bloglist
              }, {
                  Log.e("RemotePostFragment", "failed got message ${it.message}")
              })
  
  
          mRecyclerview.adapter = theAdapter
          mRecyclerview.layoutManager = LinearLayoutManager(this.context)
      }
  </code></pre>
  
  <p>The problem is that i only load the data from the android room db but its never fetched from the server. When i do the raw query from the server that's used from the fetcher, i'm able to get a List of Blogs. But when i use it in the Fetcher, i'm not able to automatically sync. </p>
  
  <p>My blogRemoteService returns a Single> correctly when tested on its own. What could i be doing wrong?</p>