mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(coderd): prevent task working notification for first app status (#20313)
Disclaimer: Claude did all of this, reviewed and committed by me. I find the "task is working" notification straight after creation to be unnecessary. Added logic to skip the notification if the first app status is "working".
This commit is contained in:
+12
-2
@@ -1008,16 +1008,26 @@ func TestTasksNotification(t *testing.T) {
|
||||
isNotificationSent: false,
|
||||
taskPrompt: "NonNotifiedTransition",
|
||||
},
|
||||
// Should send TemplateTaskWorking when the AI task transitions to 'Working'.
|
||||
// Should NOT send TemplateTaskWorking when the AI task's FIRST status is 'Working' (obvious state).
|
||||
{
|
||||
name: "TemplateTaskWorking",
|
||||
latestAppStatuses: nil,
|
||||
newAppStatus: codersdk.WorkspaceAppStatusStateWorking,
|
||||
isAITask: true,
|
||||
isNotificationSent: true,
|
||||
isNotificationSent: false,
|
||||
notificationTemplate: notifications.TemplateTaskWorking,
|
||||
taskPrompt: "TemplateTaskWorking",
|
||||
},
|
||||
// Should send TemplateTaskIdle when the AI task's FIRST status is 'Idle' (task completed immediately).
|
||||
{
|
||||
name: "InitialTemplateTaskIdle",
|
||||
latestAppStatuses: nil,
|
||||
newAppStatus: codersdk.WorkspaceAppStatusStateIdle,
|
||||
isAITask: true,
|
||||
isNotificationSent: true,
|
||||
notificationTemplate: notifications.TemplateTaskIdle,
|
||||
taskPrompt: "InitialTemplateTaskIdle",
|
||||
},
|
||||
// Should send TemplateTaskWorking when the AI task transitions to 'Working' from 'Idle'.
|
||||
{
|
||||
name: "TemplateTaskWorkingFromIdle",
|
||||
|
||||
Reference in New Issue
Block a user