refactor: enhance platform configuration, database schema handling, and Keycloak setup

Improved `PlatformConfig` API base URL resolution with enhanced logging and fallback logic. Revised database initialization with version checks, schema migration, and error handling. Updated Keycloak configuration to enable `Direct Access Grants` and refine CORS/redirect settings. Adjusted Webpack proxy settings for correct API routing.
This commit is contained in:
2026-01-27 15:12:58 +01:00
parent bddeba81be
commit 637d610a5b
12 changed files with 250 additions and 38 deletions
@@ -13,11 +13,12 @@ class PingEventRepositoryImpl(
) : SyncableRepository<PingEvent> {
// The `since` parameter for our sync is the ID of the last event, not a timestamp.
override suspend fun getLatestSince(): String? = withContext(Dispatchers.Default) {
db.appDatabaseQueries.selectLatestPingEventId().executeAsOneOrNull()
override suspend fun getLatestSince(): String? {
// Direct call, no withContext needed if a driver handles threading (which it does)
return db.appDatabaseQueries.selectLatestPingEventId().executeAsOneOrNull()
}
override suspend fun upsert(items: List<PingEvent>) = withContext(Dispatchers.Default) {
override suspend fun upsert(items: List<PingEvent>) {
// Always perform bulk operations within a transaction.
db.transaction {
items.forEach { event ->