fix: harden upstream and downstream receipt delivery

This commit is contained in:
hectorzhao
2026-07-25 23:32:13 +08:00
parent 5018167696
commit 54617c927e
18 changed files with 1797 additions and 779 deletions
+16
View File
@@ -1266,6 +1266,22 @@ export type DownstreamDeliveryRecord = {
tenant?: TenantOption | null;
application?: EnterpriseApplication | null;
messageRecord?: SmsMessageRecord | null;
attempts?: Array<{
id: string;
attemptNo: number;
connectionId?: string | null;
sequenceId?: string | null;
messageId?: string | null;
status: string;
sentAt?: string | null;
ackDeadlineAt?: string | null;
acknowledgedAt?: string | null;
ackResult?: number | null;
failureType?: string | null;
errorMessage?: string | null;
createdAt: string;
updatedAt: string;
}>;
};
export type BatchRequeueResponse = {
@@ -66,6 +66,35 @@ function DeliveryDetailModal({ record, onClose }: { record: DownstreamDeliveryRe
<div><span> ID</span><strong>{record.connectionId ?? '-'}</strong></div>
<div className="detail-grid__wide"><span></span><strong>{record.lastError ?? '-'}</strong></div>
</div>
<section className="report-history">
<h3></h3>
<div className="downstream-attempt-table" role="table" aria-label="逐次投递记录">
<div className="downstream-attempt-table__header" role="row">
<span> / </span><span> / ACK </span><span> / Sequence / Msg_Id</span><span></span>
</div>
{(record.attempts ?? []).map((attempt) => (
<div key={attempt.id} role="row">
<strong> {attempt.attemptNo} <br />{attempt.status}</strong>
<span>
{attempt.sentAt ? formatDateTime(attempt.sentAt) : '-'}
<br />
ACK{attempt.acknowledgedAt ? formatDateTime(attempt.acknowledgedAt) : '-'}
</span>
<span>
{attempt.connectionId ?? '-'}
<br />
Seq{attempt.sequenceId ?? '-'} / Msg{attempt.messageId ?? '-'}
</span>
<span>
ACK Result{attempt.ackResult ?? '-'}
<br />
{attempt.errorMessage ?? attempt.failureType ?? '-'}
</span>
</div>
))}
{(record.attempts ?? []).length === 0 ? <p></p> : null}
</div>
</section>
<section className="report-history">
<h3>Payload</h3>
<pre style={{ whiteSpace: 'pre-wrap', wordBreak: 'break-word', margin: 0 }}>{payloadText}</pre>
+28
View File
@@ -8700,6 +8700,34 @@ h3 {
color: var(--color-text-strong);
}
.downstream-attempt-table {
border-top: 0;
display: block;
overflow-x: auto;
padding: 0;
}
.downstream-attempt-table > div {
align-items: start;
border-top: 1px solid var(--color-border);
display: grid;
gap: var(--space-4);
grid-template-columns: minmax(110px, .7fr) minmax(190px, 1.1fr) minmax(260px, 1.5fr) minmax(180px, 1fr);
min-width: 820px;
padding: var(--space-3) 0;
}
.downstream-attempt-table .downstream-attempt-table__header {
color: var(--color-text-muted);
font-size: var(--font-size-sm);
font-weight: 600;
}
.downstream-attempt-table > p {
color: var(--color-text-muted);
margin: var(--space-3) 0 0;
}
.admin-task-template-row .ui-inline-text-preview {
background: var(--color-bg-subtle);
}