Don't call a Merge & continue a dismissal of the ready call

This commit is contained in:
Ian Gulliver
2026-10-20 15:01:26 -07:00
parent a95e0ddb29
commit cf9ee03284
7 changed files with 21 additions and 7 deletions
+6 -2
View File
@@ -789,7 +789,7 @@ func (s *Store) SuggestDiscard(ctx context.Context, id, reason, actor string) er
return s.setReady(ctx, id, actor, "discard", "task.discard_suggested", map[string]any{"id": id, "reason": reason})
}
func (s *Store) ClearReady(ctx context.Context, id, actor string) error {
func (s *Store) ClearReady(ctx context.Context, id, actor, reason string) error {
return s.write(ctx, func(tx *sql.Tx, emit emitFunc) error {
projectID := ""
err := tx.QueryRowContext(ctx, `UPDATE tasks SET ready = '' WHERE id = ? AND status = ? AND ready != '' RETURNING project_id`, id, string(api.TaskStatusActive)).Scan(&projectID)
@@ -799,7 +799,11 @@ func (s *Store) ClearReady(ctx context.Context, id, actor string) error {
if err != nil {
return err
}
return emit(api.Event{Kind: "task.ready_cleared", ProjectId: &projectID, TaskId: &id, Actor: actor, Payload: map[string]any{"id": id}})
payload := map[string]any{"id": id}
if reason != "" {
payload["reason"] = reason
}
return emit(api.Event{Kind: "task.ready_cleared", ProjectId: &projectID, TaskId: &id, Actor: actor, Payload: payload})
})
}