fix: dedupe active live conversation sessions#87
Conversation
|
Self-review after implementation, taking the requested outsider/senior-dev stance:
Recommended action/fix: enforce the invariant in the database, not only in application code. Add a partial unique index on Applied: added
Recommended action/fix: after insert failure, re-read the open session for the conversation. If found, return it with Applied: added
Recommended action/fix: keep the sequential reuse and stopped-session restart tests, and add a targeted race simulation where insert fails after another session appears. Applied: expanded the live-session mock and added the concurrent-create race test. |
Summary
existing: true|falseso callers can distinguish reuse from creation.Validation
npm test -- --run tests/api-auth.test.tsnpm testnpm run checkgit diff --checknpm run buildMilestone
gh api repos/agent-comms/agent-comms-core/milestones; none were returned.Closes #81