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

RecordState Ignored #284

Open
PaulWoitaschek opened this issue Nov 5, 2017 · 2 comments
Open

RecordState Ignored #284

PaulWoitaschek opened this issue Nov 5, 2017 · 2 comments

Comments

@PaulWoitaschek
Copy link
Contributor

I tried to implement the persister.

At first access, my database has no entries. So I return RecordState.MISSING.

I expect the store to make a request in that case. But instead it calls my persister (which returns an empty list as there are no entries yet) and delivers the empty list.

@digitalbuddha
Copy link
Contributor

You're right it's not working as expected, seems like stale is being handled correctly but not missing. I'll take a look tonight. Thank you for reporting.

@ramonaharrison
Copy link
Contributor

It looks like an appropriate way to handle this could be by returning Maybe.empty() from RealInternalStore#disk when the persister is a RecordProvider with RecordState.MISSING -- this would trigger the store to switch to fetch() before calling the persister.

We could add a helper method for this to the StoreUtil class, similar to the existing method for determining if the persister is stale.

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

3 participants