Research: Fix Audit Chat Active Conversation Preservation
Feature: 093-fix-audit-chat-active-preserve Date: 2026-03-17
No Outstanding Unknowns​
All technical decisions were resolved during specification and clarification. No external research was required.
Decision Log​
1. Preserve active conversation regardless of message count​
- Decision: Remove
conv.messages.length > 0gate from thelocalOnlyPreservedfilter - Rationale: The
activeConversationIdis set synchronously when the user navigates to a conversation. Messages load asynchronously vialoadMessagesFromServer. The message count gate creates a race condition where the periodicloadConversationsFromServerrefresh can fire between navigation and message load completion, wiping the conversation from the store. - Alternatives considered:
- Grace period timer after activation — rejected (adds complexity, still has a timing window)
- Separate
isMessageLoadingstate flag — rejected (over-engineering for one predicate change) - Debounce
loadConversationsFromServerafter navigation — rejected (delays all refreshes, not just audit conversations)
2. Align local-only path with server-returned path​
- Decision: Match the behavior already present in the server-conversation mapping (lines 847-851) where
isActivealone preserves messages without a count check - Rationale: Consistency within the same function reduces surprise. Both code paths handle the same conceptual scenario (active conversation during refresh) and should use the same criteria.
- Alternatives considered: None — this is clearly the right approach for consistency