Migrate frontend realtime messaging to SSE.

Switch service integrations and screen/store consumers from websocket events to SSE, and ignore generated dist-web artifacts.

Made-with: Cursor
This commit is contained in:
2026-03-10 12:58:23 +08:00
parent 63e32b15a3
commit be84c01abd
25 changed files with 974 additions and 1305 deletions

View File

@@ -459,9 +459,21 @@ export const deleteMessage = async (messageId: string): Promise<void> => {
};
// 更新消息状态(如撤回)
export const updateMessageStatus = async (messageId: string, status: string): Promise<void> => {
// clearContent=true 时,会同时清空本地存储的消息内容与 segments仅保留状态占位
export const updateMessageStatus = async (
messageId: string,
status: string,
clearContent: boolean = false
): Promise<void> => {
await enqueueWrite(async () => {
const database = await getDb();
if (clearContent) {
await database.runAsync(
`UPDATE messages SET status = ?, content = '', segments = '[]' WHERE id = ?`,
[status, messageId]
);
return;
}
await database.runAsync(
`UPDATE messages SET status = ? WHERE id = ?`,
[status, messageId]