|
|
@ -67,7 +67,7 @@ class OfflineFirstNewsRepository @Inject constructor(
|
|
|
|
},
|
|
|
|
},
|
|
|
|
modelDeleter = newsResourceDao::deleteNewsResources,
|
|
|
|
modelDeleter = newsResourceDao::deleteNewsResources,
|
|
|
|
modelUpdater = { changedIds ->
|
|
|
|
modelUpdater = { changedIds ->
|
|
|
|
changedIds.chunked(SYNC_BATCH_SIZE).forEach { chunkedIds
|
|
|
|
changedIds.chunked(SYNC_BATCH_SIZE).forEach { chunkedIds ->
|
|
|
|
val networkNewsResources = network.getNewsResources(ids = chunkedIds)
|
|
|
|
val networkNewsResources = network.getNewsResources(ids = chunkedIds)
|
|
|
|
|
|
|
|
|
|
|
|
// Order of invocation matters to satisfy id and foreign key constraints!
|
|
|
|
// Order of invocation matters to satisfy id and foreign key constraints!
|
|
|
@ -80,7 +80,7 @@ class OfflineFirstNewsRepository @Inject constructor(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
newsResourceDao.upsertNewsResources(
|
|
|
|
newsResourceDao.upsertNewsResources(
|
|
|
|
newsResourceEntities = networkNewsResources.map(
|
|
|
|
newsResourceEntities = networkNewsResources.map(
|
|
|
|
NetworkNewsResource::asEntity
|
|
|
|
NetworkNewsResource::asEntity,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
newsResourceDao.insertOrIgnoreTopicCrossRefEntities(
|
|
|
|
newsResourceDao.insertOrIgnoreTopicCrossRefEntities(
|
|
|
|