remove :storage-ksqlite (conversation/message) and related tests; decouple schema from journal
ci / JVM build + tests (push) Successful in 6m6s
ci / JVM build + tests (push) Successful in 6m6s
This commit is contained in:
@@ -317,6 +317,11 @@ class ChatAgent(
|
||||
conv?.close()
|
||||
val ok = mutableConversationStore.delete(id)
|
||||
if (ok) {
|
||||
// Каскад — здесь, потому что владелец lifecycle диалога
|
||||
// (ChatAgent) имеет доступ ко всем трём store'ам, а каждый
|
||||
// отдельный store должен знать только про свою таблицу.
|
||||
messageStore.clear(id)
|
||||
workingMemoryStore.clear(id)
|
||||
val event = AgentEvent.Deleted(date = now(), id = id)
|
||||
eventStore.append(CommonEvent.Agent(date = now(), event = event))
|
||||
}
|
||||
|
||||
+5
@@ -116,6 +116,11 @@ class PersistenceTest {
|
||||
val removed = stores.conversations.delete("c1")
|
||||
assertTrue(removed)
|
||||
assertNull(stores.conversations.get("c1"))
|
||||
// conversations.delete больше не каскадит — это делает владелец
|
||||
// lifecycle (ChatAgent). Здесь проверяем, что каждый store делает
|
||||
// только свою таблицу чистой при ручном вызове.
|
||||
stores.messages.clear("c1")
|
||||
stores.workingMemory.clear("c1")
|
||||
assertEquals(emptyList(), stores.messages.listFlow("c1", Instant.DISTANT_PAST).toList())
|
||||
assertEquals(emptyList(), stores.workingMemory.list("c1"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user