Merge branch 'fix/conversation-delete-reappears' into main
Deploy to Production / deploy (push) Waiting to run Details
Test / backend-test (push) Waiting to run Details
Test / frontend-unit (push) Waiting to run Details
Test / api-e2e (push) Waiting to run Details
Test / frontend-e2e (push) Waiting to run Details

Fixes private-board conversation deletion reappearing after refresh.
- board_started now marks conversation is_local=false (server persisted)
- loadConversations explicitly sets is_local=false as safety net
This commit is contained in:
Chiguyong 2026-07-06 16:14:03 +08:00
commit 306c6031a5
2 changed files with 14 additions and 0 deletions

View File

@ -209,6 +209,9 @@ export const useChatStore = defineStore("chat", () => {
// @board meeting (board_started persisted). Frontend uses this
// to render the "私董会" badge in the sidebar.
is_board: conv.is_board === true,
// Anything returned from the server is already persisted — mark it
// non-local so deleteConversation routes to the server endpoint.
is_local: false,
}));
} catch (error) {
console.error("Failed to load conversations:", error);

View File

@ -1157,6 +1157,17 @@ export function dispatchWsEvent(
board_round: 0,
};
state.appendMessage(conversationId, startMsg);
// Board meetings are persisted server-side as soon as board_started
// is emitted (portal intercepts and saves the message). Mark the
// conversation non-local so deleteConversation calls the server
// instead of only removing it from the local list — otherwise the
// conversation reappears on the next refresh.
const conv = state.conversations.value.find(
(c) => c.id === conversationId,
);
if (conv) {
conv.is_local = false;
}
}
break;
}