Ensure old extension store is removed if index url changes (#3408)

This commit is contained in:
AntsyLich
2026-06-14 00:14:16 +06:00
committed by GitHub
parent 1a030420b1
commit c15f7bee85
@@ -39,7 +39,14 @@ class ExtensionStoreRepositoryImpl(
try {
database.extension_storeQueries.getAll().awaitAsList().forEach { store ->
service.fetch(store.index_url)
.mapCatching { upsert(it) }
.mapCatching {
database.transaction {
upsert(it)
if (store.index_url != it.indexUrl) {
database.extension_storeQueries.delete(store.index_url)
}
}
}
.onFailure {
logcat(LogPriority.ERROR, it) {
"Failed to refresh extension store '${store.name} (${store.index_url})'"