refactor(message): simplify state management and remove redundant service methods
All checks were successful
Frontend CI / ota-ios (push) Successful in 1m36s
Frontend CI / ota-android (push) Successful in 1m36s
Frontend CI / build-and-push-web (push) Successful in 5m6s
Frontend CI / build-android-apk (push) Successful in 39m18s

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:
2026-05-12 18:26:27 +08:00
parent 48f31e6617
commit 7e0436a799
12 changed files with 5 additions and 339 deletions

View File

@@ -1,10 +1,6 @@
/**
* 消息同步服务
* 处理消息和会话的服务器同步逻辑
*
* 重构说明:
* - 直接使用 zustand store 替代 IMessageStateManager
* - 移除了 SubscriptionManager 调用Zustand 的 set() 会自动触发组件重渲染
*/
import type { ConversationResponse, MessageResponse } from '../../../types/dto';