Local message cache: instant start + offline reading (SQLDelight)

- Cache.sq / ChatDb: lanes, channels and last_lane persisted as JSON
  snapshots; sanitize on restore (Pending->Failed, streaming->false);
  ephemeral items (tool, system) skipped
- Platform drivers via expect/actual: AndroidSqliteDriver (app db dir)
  / JdbcSqliteDriver (~/.iris/iris_cache.db)
- IrisController: restore before connect, debounced (750ms) snapshot
  persistence, synchronous flush on dispose, clearAll on forget
- History robustness: historyLoaded marked only when the response is
  processed (lost request/response retried on reconnect); events
  collector wrapped in try/catch; onHelloAck fast path so the history
  request fires on the WS thread instead of the starved state
  collector; frame-decode and history-load logging
- Protocol: HistoryMessage.media nullable (defensive vs older
  gateways that sent "media": null)
- Tests: ChatDbTest (jvmTest, JDBC in-memory), ChatStoreCacheTest,
  HistoryPayloadTest, HistoryWireTest (real captured 92KB response)
- docs/10: §10.7 implemented schema, new §10.9 cache behavior
This commit is contained in:
ARIA committed 2026-08-21 20:56:20 +02:00
1 parent 9a519e3c5a
commit 81f42ab761
18 files changed
+1040 -268

No files matched your search

+2
View File
@@ -19,6 +19,8 @@ plugins {
id("com.android.kotlin.multiplatform.library") version "9.3.1" apply false
id("org.jetbrains.compose") version "1.11.1" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.4.10" apply false
// Local cache DB (docs/16: "Local DB (KMP) — SQLDelight").
id("app.cash.sqldelight") version "2.3.2" apply false
}
tasks.register("clean") {