fix(extension-store): Migrate to extension store during restore/sync legacy backup (#1746)

This commit is contained in:
Cuong-Tran 2026-07-09 02:05:39 +07:00 committed by GitHub
parent da57b3db07
commit ce6a0ea7fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,8 +12,15 @@ class ExtensionStoreRestorer(
suspend operator fun invoke(
backupStore: BackupExtensionStore,
) {
// KMK -->
val indexUrl = if (backupStore.isLegacy == null) {
backupStore.indexUrl.removeSuffix("/index.min.json").removeSuffix("/index.json") + "/repo.json"
} else {
backupStore.indexUrl
}
// KMK <--
database.extension_storeQueries.upsert(
indexUrl = backupStore.indexUrl,
indexUrl = indexUrl,
name = backupStore.name,
badgeLabel = backupStore.badgeLabel ?: backupStore.name,
signingKey = backupStore.signingKey,