Possibly fixed-for-good a bug that caused events to be fetched but not stored properly in the database; I believe this was caused by FetcherActivity.kt sequentially executing nukeEvents() and insertEvents(), but doing both asynchronously, and individually, which could mean that insertEvents() finishes before nukeEvents() and therefore nukeEvents() would delete the old events as well as the new ones. This doesn't seem entirely logical to me, as no ConflictStrategy has been configured, and inserting new events before the old ones have been cleared (since they both start their primary keys at 0) would have crashed the app.

This commit is contained in:
denizk0461
2023-04-28 15:14:50 +02:00
parent aa5d32e64a
commit 509a0434c5
15 changed files with 82 additions and 69 deletions
@@ -66,7 +66,7 @@ class EventPageFragment(
// Set up LiveData observer to refresh the view on update
viewModel.getEventsForDay(currentDay).observe(viewLifecycleOwner) { events ->
// eventAdapter.setNewItems(events)
eventAdapter.setNewData(events)
}
}