mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 13:29:44 +02:00
fix(ws): include issue_id in task:dispatch event to prevent cross-issue UI glitch
broadcastTaskDispatch was the only task event broadcast missing issue_id in its WebSocket payload. The frontend task:dispatch handler had no way to filter by issue, causing AgentLiveCard to briefly show activity for the wrong issue when multiple tabs are open. Closes https://github.com/multica-ai/multica/issues/791
This commit is contained in:
@@ -208,7 +208,9 @@ export function AgentLiveCard({ issueId }: AgentLiveCardProps) {
|
||||
// Pick up newly dispatched tasks
|
||||
useWSEvent(
|
||||
"task:dispatch",
|
||||
useCallback(() => {
|
||||
useCallback((payload: unknown) => {
|
||||
const p = payload as { issue_id?: string };
|
||||
if (p.issue_id && p.issue_id !== issueId) return;
|
||||
api.getActiveTasksForIssue(issueId).then(({ tasks }) => {
|
||||
setTaskStates((prev) => {
|
||||
const next = new Map(prev);
|
||||
|
||||
@@ -461,6 +461,8 @@ func (s *TaskService) broadcastTaskDispatch(ctx context.Context, task db.AgentTa
|
||||
}
|
||||
payload["task_id"] = util.UUIDToString(task.ID)
|
||||
payload["runtime_id"] = util.UUIDToString(task.RuntimeID)
|
||||
payload["issue_id"] = util.UUIDToString(task.IssueID)
|
||||
payload["agent_id"] = util.UUIDToString(task.AgentID)
|
||||
|
||||
workspaceID := s.resolveTaskWorkspaceID(ctx, task)
|
||||
if workspaceID == "" {
|
||||
|
||||
Reference in New Issue
Block a user