I am trying to find out in the code below, why is it that Room\'s LiveData observable does not give me new shifts once I populate the database with new data.
This is
In my case, it was because I was using a MediatorLiveData to convert the entities returned from the database and forgot to call setValue()
with the converted result, so the mediator was only relying requests to the database but never notifying results.
override fun getItems() = MediatorLiveData>().apply {
addSource(itemDao().getItems()) {
// I was previously only converting the items, without calling 'value ='
value = it.map(ItemWithTags::toDto)
}
}