dialogue: a restart expires the parked question (V-385)
The decision, not a behaviour change: ClarifyStore stays in memory, and she does not announce the loss either. The TTL and the attempt count measure a pause in one conversation. A restart is a gap of unknown length, so a restored question is either dead already or lying about its age, and the request behind it is one he has likely given up on. Announcing it would mean storing a marker that outlives the thing it describes, to say one sentence in the rare window where he speaks within 90s of a restart. His next words route fresh, which is right either way. Written down in docs/design.md, pinned at both ends by a comment, and held by a test that builds a second handler over the same store.
This commit is contained in:
@@ -57,6 +57,14 @@ func (q *PendingQuestion) CanAsk() bool {
|
||||
|
||||
// ClarifyStore holds the parked questions. Same shape and locking as
|
||||
// SessionStore: keyed by dialogue id, expired entries dropped on read.
|
||||
//
|
||||
// Memory only, deliberately, unlike SessionStore — a restart expires every
|
||||
// parked question and she does not announce that it happened (Vikunja #385,
|
||||
// written down in docs/design.md). The 90s TTL and the attempt count measure a
|
||||
// pause in one conversation, and a restart is a gap of unknown length, so a
|
||||
// restored question would either be dead already or lying about its age. His
|
||||
// next words route fresh, which is the right answer with or without a notice.
|
||||
// Do not give this store a persister without re-arguing that.
|
||||
type ClarifyStore struct {
|
||||
mu sync.RWMutex
|
||||
questions map[string]*PendingQuestion
|
||||
|
||||
Reference in New Issue
Block a user