refactor(message): simplify state management and remove redundant service methods
Refactor the message module to streamline state management by removing the `MessageStateManager` and `SubscriptionManager` layers, relying instead on Zustand's built-in selector mechanism for reactive updates. - Remove redundant `setConversations`, `addMessage`, and `updateMessage` actions from the Zustand store to favor more specialized update methods. - Clean up `MessageService` by removing deprecated conversation and message sending convenience methods. - Update service interfaces to support new synchronization capabilities including `syncBySeq` and `restartSources`. - Simplify documentation and comments across the message store and its associated services.
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
/**
|
||||
* 消息同步服务
|
||||
* 处理消息和会话的服务器同步逻辑
|
||||
*
|
||||
* 重构说明:
|
||||
* - 直接使用 zustand store 替代 IMessageStateManager
|
||||
* - 移除了 SubscriptionManager 调用,Zustand 的 set() 会自动触发组件重渲染
|
||||
*/
|
||||
|
||||
import type { ConversationResponse, MessageResponse } from '../../../types/dto';
|
||||
|
||||
Reference in New Issue
Block a user