feat(desktop&tenant): Enhance desktop account and task consumer presence management
Desktop Client Build / Resolve Build Metadata (push) Successful in 1m13s
Desktop Client Build / Build Desktop Client (push) Has been cancelled
Desktop Client Build / Publish Client Artifacts to NAS (push) Has been cancelled
Backend CI / Backend (push) Failing after 13m49s
Frontend CI / Frontend (push) Successful in 6m38s
Desktop Client Build / Resolve Build Metadata (push) Successful in 1m13s
Desktop Client Build / Build Desktop Client (push) Has been cancelled
Desktop Client Build / Publish Client Artifacts to NAS (push) Has been cancelled
Backend CI / Backend (push) Failing after 13m49s
Frontend CI / Frontend (push) Successful in 6m38s
- Added new fields to DesktopAccountInfo for tracking account session and task consumer online status, along with queued publish task count and oldest queued publish task timestamp. - Updated DesktopDispatchEvent to include server time for better synchronization. - Implemented separate presence management for task consumers, including marking presence and loading presence state. - Enhanced DesktopAccountService to apply publish queue summaries and manage task consumer presence. - Introduced new methods for replaying queued publish tasks in DesktopDispatchHandler. - Updated tests to cover new presence management logic and ensure correct behavior of account session and task consumer online status.
This commit is contained in:
@@ -20,27 +20,28 @@ import (
|
||||
// the existing SSE handler on the desktop client can treat both channels the
|
||||
// same way and dedupe by task_id.
|
||||
type DesktopDispatchEvent struct {
|
||||
Type string `json:"type"`
|
||||
TaskID string `json:"task_id"`
|
||||
JobID string `json:"job_id,omitempty"`
|
||||
WorkspaceID int64 `json:"workspace_id"`
|
||||
TargetAccountID string `json:"target_account_id,omitempty"`
|
||||
TargetClientID string `json:"target_client_id"`
|
||||
Platform string `json:"platform,omitempty"`
|
||||
Title *string `json:"title,omitempty"`
|
||||
BusinessDate *string `json:"business_date,omitempty"`
|
||||
SchedulerGroupKey *string `json:"scheduler_group_key,omitempty"`
|
||||
QuestionText *string `json:"question_text,omitempty"`
|
||||
Status string `json:"status"`
|
||||
Kind string `json:"kind"`
|
||||
Priority int `json:"priority,omitempty"`
|
||||
Lane string `json:"lane,omitempty"`
|
||||
InterruptGeneration int `json:"interrupt_generation,omitempty"`
|
||||
SignalOnly bool `json:"signal_only,omitempty"`
|
||||
Control string `json:"control,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
ReplacementTaskID string `json:"replacement_task_id,omitempty"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
Type string `json:"type"`
|
||||
TaskID string `json:"task_id"`
|
||||
JobID string `json:"job_id,omitempty"`
|
||||
WorkspaceID int64 `json:"workspace_id"`
|
||||
TargetAccountID string `json:"target_account_id,omitempty"`
|
||||
TargetClientID string `json:"target_client_id"`
|
||||
Platform string `json:"platform,omitempty"`
|
||||
Title *string `json:"title,omitempty"`
|
||||
BusinessDate *string `json:"business_date,omitempty"`
|
||||
SchedulerGroupKey *string `json:"scheduler_group_key,omitempty"`
|
||||
QuestionText *string `json:"question_text,omitempty"`
|
||||
Status string `json:"status"`
|
||||
Kind string `json:"kind"`
|
||||
Priority int `json:"priority,omitempty"`
|
||||
Lane string `json:"lane,omitempty"`
|
||||
InterruptGeneration int `json:"interrupt_generation,omitempty"`
|
||||
SignalOnly bool `json:"signal_only,omitempty"`
|
||||
Control string `json:"control,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
ReplacementTaskID string `json:"replacement_task_id,omitempty"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ServerTime *time.Time `json:"server_time,omitempty"`
|
||||
}
|
||||
|
||||
// DispatchSubscriber represents a live WebSocket connection bound to a single
|
||||
|
||||
Reference in New Issue
Block a user