Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Request is made multiple times #388

Open
marcin-adamczewski opened this issue Oct 28, 2019 · 0 comments
Open

Request is made multiple times #388

marcin-adamczewski opened this issue Oct 28, 2019 · 0 comments

Comments

@marcin-adamczewski
Copy link

Hi,

I'm testing your library and have noticed that when store.get() is called multiple times in the same time, then the request is made also multiple times, despite having either memory cache or persister.

Steps to reproduce using sample app:

  1. Open PersistingStoreActivity
  2. Change persistedStore.get() method to
persistedStore
                .getWithResult(awwRequest)
                .map(result -> {
                    Log.d("lol", result.source().toString());
                    return result.value();
                })

In order to see the source.
3. In onResume() method call loadPosts(); method multiple times instead of one time.
4. Logs prints NETWORK multiple times.

Make sure to make a clean app install as there is a persister added or remove persister and add memory cache.
I've noticed that inFlightRequests didn't cache the first Single.

PS I had to change baseUrl to .baseUrl("https://reddit.com/") for sample app to work on Android 8 as it required https instead of http.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant