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

(cherry picked from commit c15f7bee85b8fbe258abe81433730aa5bcba58a1)
This commit is contained in:
AntsyLich 2026-06-14 00:14:16 +06:00 committed by Cuong-Tran
parent 5e809fefd4
commit eb84ab8439

View file

@ -40,7 +40,14 @@ class ExtensionStoreRepositoryImpl(
extension_storeQueries.getAll()
}.forEach { store ->
service.fetch(store.index_url)
.mapCatching { upsert(it) }
.mapCatching {
handler.await {
upsert(it)
if (store.index_url != it.indexUrl) {
extension_storeQueries.delete(store.index_url)
}
}
}
.onFailure {
logcat(LogPriority.ERROR, it) {
"Failed to refresh extension store '${store.name} (${store.index_url})'"