[db] track and clear repo update errors

Historically, we've just shown a giant Toast for repo update errors, now we track them in the DB, so we can properly expose them in the UI.
This commit is contained in:
Torsten Grote
2025-12-12 12:15:42 -03:00
parent f81060859d
commit dea8a2e504
7 changed files with 75 additions and 7 deletions

View File

@@ -129,7 +129,14 @@ internal class IndexV1UpdaterTest : DbTest() {
assertIs<SigningException>(result.e)
// check that the DB transaction was rolled back and the DB wasn't changed
assertEquals(repo, repoDao.getRepository(repoId) ?: fail())
// except for adding the error to the repo
val expectedRepo = repo.copy(
preferences = repo.preferences.copy(
errorCount = 1,
lastError = "Signing certificate does not match"
),
)
assertEquals(expectedRepo, repoDao.getRepository(repoId) ?: fail())
assertEquals(0, appDao.countApps())
assertEquals(0, versionDao.countAppVersions())
}