Surface channel delivery failures on agent replies instead of swallowing them

The previous fix made a broken SMTP/Telegram account non-fatal — the
reply gets recorded either way now — but that also made delivery
failures completely invisible: an agent sees their reply "sent"
successfully with no indication the customer never actually received it.
Added messages.deliveryFailed, set whenever the outbound send throws, and
a warning badge on the message bubble so this is now visible instead of
silent.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh2UXUQUVBWroWEnn1FLFG
This commit is contained in:
ogrechkoandClaude Sonnet 5 committed 2026-10-07 08:26:54 +00:00
1 parent 8d1f91187a
commit b92d9801ff
8 files changed
+1258 -14

No files matched your search

+10 -1
View File
@@ -3,7 +3,7 @@
import { useEffect, useRef, useState } from "react";
import Link from "next/link";
import { AnimatePresence, motion } from "framer-motion";
import { ArrowLeft, Send, StickyNote, Paperclip, X, MessageSquareText } from "lucide-react";
import { ArrowLeft, Send, StickyNote, Paperclip, X, MessageSquareText, TriangleAlert } from "lucide-react";
import { useTicketEvents } from "@/lib/events/use-ticket-events";
import { formatRelativeTime } from "@/lib/format";
import { Avatar } from "@/components/avatar";
@@ -373,6 +373,15 @@ function MessageBubble({ message }: { message: MessageDTO }) {
<p className={`text-[11px] ${isAgent ? "text-white/70" : "text-text-faint"}`}>
{message.authorName} · {formatRelativeTime(message.createdAt)}
</p>
{message.deliveryFailed && (
<p
className="mt-1 flex items-center gap-1 text-[11px] font-medium text-danger"
title="Сообщение сохранено, но не дошло до клиента — проверьте настройки почты/Telegram"
>
<TriangleAlert size={11} />
Не доставлено клиенту
</p>
)}
</div>
</motion.div>
);