feat(shipping): 实现订单批处理聊天聚合展示与优化后端逻辑
This commit is contained in:
1 parent
11cef575b4
commit
523b791c92
38 files changed
+2868
-414
No files matched your search
@@ -613,6 +613,94 @@ describe('conversationProcessingProjection', () => {
|
||||
expect(projection?.summary.total_files).toBe(1);
|
||||
});
|
||||
|
||||
it('aggregates mixed order tasks from one EML intake into one card', () => {
|
||||
const base = {
|
||||
sourceType: 'eml' as const,
|
||||
rootOrderTaskNo: null,
|
||||
shippingNoticeNo: null,
|
||||
conversationId: 'conv-eml',
|
||||
submissionNo: 'SOS-EML',
|
||||
intakeNo: 'INTAKE-EML-1',
|
||||
progressVersion: 1,
|
||||
currentGate: null,
|
||||
childOrderTasks: [],
|
||||
};
|
||||
const items: ShippingProcessingProjection[] = [
|
||||
{
|
||||
...base, workItemType: 'order_task', workItemNo: 'OT-DONE', status: 'completed', stage: 'completed',
|
||||
userStatus: 'completed', userStage: 'completed', lastActivityAt: '2026-08-06T00:00:00Z', availableActions: [],
|
||||
sourceSummary: { emailSubject: 'Shipment', filename: 'a.pdf', documentCount: 1, parsedDocumentCount: 1, candidateCount: 1, customerName: null, poNumber: null },
|
||||
},
|
||||
{
|
||||
...base, workItemType: 'order_task', workItemNo: 'OT-RUN', status: 'processing', stage: 'inventory_matching',
|
||||
userStatus: 'running', userStage: 'inventory_match', lastActivityAt: '2026-08-06T00:00:01Z', availableActions: [],
|
||||
sourceSummary: { emailSubject: 'Shipment', filename: 'b.pdf', documentCount: 1, parsedDocumentCount: 1, candidateCount: 1, customerName: null, poNumber: null },
|
||||
},
|
||||
{
|
||||
...base, workItemType: 'order_task', workItemNo: 'OT-FAIL', status: 'failed', stage: 'freight_uploading',
|
||||
userStatus: 'failed', userStage: 'freight_upload', lastActivityAt: '2026-08-06T00:00:02Z', availableActions: [],
|
||||
blockingReason: { code: 'upload_rpa_failed' },
|
||||
sourceSummary: { emailSubject: 'Shipment', filename: 'c.pdf', documentCount: 1, parsedDocumentCount: 1, candidateCount: 1, customerName: null, poNumber: null },
|
||||
},
|
||||
];
|
||||
const projection = projectConversationProcessingFromWorkItems(items);
|
||||
expect(projection?.needs_action).toHaveLength(1);
|
||||
expect(projection?.processing).toHaveLength(0);
|
||||
expect(projection?.completed).toHaveLength(0);
|
||||
expect(projection?.needs_action[0]?.aggregateSummary).toEqual(expect.objectContaining({
|
||||
intakeNo: 'INTAKE-EML-1', total: 3, completed: 1, processing: 1, needsAction: 1, failed: 1,
|
||||
}));
|
||||
expect(projection?.needs_action[0]?.file_count).toBe(3);
|
||||
expect(projection?.needs_action[0]?.aggregateSummary?.reasonCodes).toContain('upload_rpa_failed');
|
||||
});
|
||||
|
||||
it('does not reuse an empty EML task when a later poll returns aggregate children', () => {
|
||||
const base = {
|
||||
workItemType: 'order_task' as const, sourceType: 'eml' as const, rootOrderTaskNo: 'OT-ROOT',
|
||||
shippingNoticeNo: null, conversationId: 'conv-stable', submissionNo: 'SOS-1', intakeNo: 'SNI-STABLE',
|
||||
progressVersion: 1, currentGate: null, availableActions: [], status: 'processing' as const,
|
||||
stage: 'document_parsing' as const, userStatus: 'running' as const, userStage: 'document_parsing' as const,
|
||||
lastActivityAt: '2026-08-06T00:00:00Z',
|
||||
sourceSummary: { emailSubject: 'mail', filename: 'stable.eml', documentCount: 1, parsedDocumentCount: 1, candidateCount: 0, customerName: null, poNumber: null },
|
||||
};
|
||||
const first = projectConversationProcessingFromWorkItems([{ ...base, workItemNo: 'INTAKE:SNI-STABLE', aggregateSummary: { intakeNo: 'SNI-STABLE', total: 1, completed: 0, processing: 1, needsAction: 0, failed: 0, stages: [], reasonCodes: [] }, aggregateChildren: [] }]);
|
||||
const child = { ...base, workItemNo: 'OT-CHILD', sourceSummary: { ...base.sourceSummary, filename: 'attachment.pdf' } };
|
||||
const second = projectConversationProcessingFromWorkItems([{ ...base, workItemNo: 'INTAKE:SNI-STABLE', aggregateSummary: { intakeNo: 'SNI-STABLE', total: 1, completed: 0, processing: 1, needsAction: 0, failed: 0, stages: [], reasonCodes: [] }, aggregateChildren: [child] }], first);
|
||||
expect(second?.processing[0]?.aggregateChildren?.map((item) => item.sourceSummary.filename)).toEqual(['attachment.pdf']);
|
||||
expect(second?.processing[0]).not.toBe(first?.processing[0]);
|
||||
});
|
||||
|
||||
it('puts an EML with review-required children into needs_action even when parent says processing', () => {
|
||||
const parent = {
|
||||
workItemType: 'order_task' as const, workItemNo: 'INTAKE:SNI-STATUS', sourceType: 'eml' as const,
|
||||
rootOrderTaskNo: null, shippingNoticeNo: null, conversationId: 'conv-status', submissionNo: 'SOS-1', intakeNo: 'SNI-STATUS',
|
||||
status: 'processing' as const, stage: 'document_parsing' as const, userStatus: 'running' as const, userGroup: 'processing' as const,
|
||||
userStage: 'document_parsing' as const, progressVersion: 1, lastActivityAt: '', currentGate: null, availableActions: [],
|
||||
sourceSummary: { emailSubject: null, filename: 'mail.eml', documentCount: 2, parsedDocumentCount: 2, candidateCount: 0, customerName: null, poNumber: null },
|
||||
aggregateChildren: [
|
||||
{ workItemType: 'order_task', workItemNo: 'OT-1', sourceType: 'eml', rootOrderTaskNo: null, shippingNoticeNo: null, conversationId: 'conv-status', submissionNo: 'SOS-1', intakeNo: 'SNI-STATUS', status: 'review_required', stage: 'review_required', userStatus: 'waiting_human', userStage: 'review_required', progressVersion: 1, lastActivityAt: '', currentGate: null, availableActions: [], sourceSummary: { emailSubject: null, filename: 'a.pdf', documentCount: 1, parsedDocumentCount: 1, candidateCount: 0, customerName: null, poNumber: null }, childOrderTasks: [], facts: { uploadState: 'not_created' } },
|
||||
{ workItemType: 'order_task', workItemNo: 'OT-2', sourceType: 'eml', rootOrderTaskNo: null, shippingNoticeNo: null, conversationId: 'conv-status', submissionNo: 'SOS-1', intakeNo: 'SNI-STATUS', status: 'processing', stage: 'document_parsing', userStatus: 'running', userStage: 'document_parsing', progressVersion: 1, lastActivityAt: '', currentGate: null, availableActions: [], sourceSummary: { emailSubject: null, filename: 'b.pdf', documentCount: 1, parsedDocumentCount: 1, candidateCount: 0, customerName: null, poNumber: null }, childOrderTasks: [], facts: { uploadState: 'not_created' } },
|
||||
],
|
||||
} as any;
|
||||
const projection = projectConversationProcessingFromWorkItems([parent]);
|
||||
expect(projection?.needs_action).toHaveLength(1);
|
||||
expect(projection?.processing).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('does not aggregate direct PDFs with matching intake numbers', () => {
|
||||
const common = {
|
||||
workItemType: 'order_task' as const, rootOrderTaskNo: null, shippingNoticeNo: null,
|
||||
conversationId: 'conv-pdf', submissionNo: 'SOS-PDF', intakeNo: 'INTAKE-SAME', progressVersion: 1,
|
||||
currentGate: null, childOrderTasks: [], status: 'processing' as const, stage: 'document_parsing' as const,
|
||||
userStatus: 'running' as const, userStage: 'document_parsing' as const, lastActivityAt: '2026-08-06T00:00:00Z', availableActions: [],
|
||||
};
|
||||
const projection = projectConversationProcessingFromWorkItems([
|
||||
{ ...common, workItemNo: 'OT-1', sourceType: 'direct_pdf', sourceSummary: { emailSubject: null, filename: 'a.pdf', documentCount: 1, parsedDocumentCount: 0, candidateCount: 0, customerName: null, poNumber: null } },
|
||||
{ ...common, workItemNo: 'OT-2', sourceType: 'direct_pdf', sourceSummary: { emailSubject: null, filename: 'b.pdf', documentCount: 1, parsedDocumentCount: 0, candidateCount: 0, customerName: null, poNumber: null } },
|
||||
]);
|
||||
expect(projection?.processing).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('prefers work_items task lists over embedded conversation_processing when both exist', () => {
|
||||
const workItems: ShippingProcessingProjection[] = [
|
||||
{
|
||||
@@ -693,7 +781,10 @@ describe('conversationProcessingProjection', () => {
|
||||
const projection = resolveConversationProcessingFromUnified(workItems, embedded);
|
||||
// 关键断言:兄弟 OT 仅出现在 work_items;embedded 缺 sibling 时不得覆盖任务列表。
|
||||
expect(projection?.needs_action.map((t) => t.user_task_no)).toEqual(['OT-ROOT']);
|
||||
expect(projection?.processing.map((t) => t.user_task_no)).toEqual(['OT-SIBLING']);
|
||||
expect(projection?.processing).toEqual([]);
|
||||
expect(projection?.needs_action[0]?.aggregateSummary).toEqual(expect.objectContaining({
|
||||
intakeNo: 'SNI-1', total: 2, completed: 0, processing: 1, needsAction: 1,
|
||||
}));
|
||||
expect(projection?.focused_task_no).toBe('OT-ROOT');
|
||||
expect(projection?.recent_task_no).toBe('OT-SIBLING');
|
||||
});
|
||||
@@ -1006,7 +1097,7 @@ describe('conversationProcessingProjection — normalize & semantic & stabilize'
|
||||
expect(result!.needs_action[0]!.title).toBe('b.pdf');
|
||||
});
|
||||
|
||||
it('resolveConversationProcessingFromUnified: work_items 仅含 order_intake 时,仍走 embedded normalize 路径(过渡窗口不跳状态)', () => {
|
||||
it('resolveConversationProcessingFromUnified: 仅含 EML order_intake 时,派生统一 processing 投影而非回退 embedded', () => {
|
||||
const embedded: ConversationProcessingProjection = {
|
||||
summary: { total_tasks: 1, total_files: 1, processing: 1, needs_action: 0, completed: 0, history: 0 },
|
||||
focused_task_no: 'OT-LEG3',
|
||||
@@ -1035,7 +1126,7 @@ describe('conversationProcessingProjection — normalize & semantic & stabilize'
|
||||
{
|
||||
workItemType: 'order_intake',
|
||||
workItemNo: 'SNI-1',
|
||||
sourceType: 'direct_pdf',
|
||||
sourceType: 'eml',
|
||||
rootOrderTaskNo: null,
|
||||
shippingNoticeNo: null,
|
||||
conversationId: 'conv-1',
|
||||
@@ -1061,13 +1152,16 @@ describe('conversationProcessingProjection — normalize & semantic & stabilize'
|
||||
];
|
||||
const result = resolveConversationProcessingFromUnified(workItems, embedded);
|
||||
expect(result).not.toBeNull();
|
||||
// 过渡阶段:order_intake 不触发统一投影派生;embedded waiting_human 必须 normalize 成 waiting_review/needs_action
|
||||
// EML 尚未创建 OT 时,也必须作为一张 EML 卡进入统一“系统处理中”区。
|
||||
expect(result!.focused_task_no).toBe('OT-LEG3');
|
||||
expect(result!.processing.length).toBe(0);
|
||||
expect(result!.needs_action.length).toBe(1);
|
||||
expect(result!.needs_action[0]!.status_label).toBe('waiting_review');
|
||||
expect(result!.needs_action[0]!.title).toBe('c.pdf');
|
||||
expect(result!.needs_action[0]!.group).toBe('needs_action');
|
||||
expect(result!.needs_action).toHaveLength(0);
|
||||
expect(result!.processing).toHaveLength(1);
|
||||
expect(result!.processing[0]).toMatchObject({
|
||||
user_task_no: 'SNI-1',
|
||||
title: 'c.pdf',
|
||||
group: 'processing',
|
||||
status_label: 'processing',
|
||||
});
|
||||
});
|
||||
|
||||
it('resolveConversationProcessingFromUnified + IntakeOtStabilizer: 看到 order_task 后 2s 内暂缺 OT 保持 previousProjection(避免轮询抖动)', () => {
|
||||
|
||||
@@ -50,6 +50,15 @@ export function buildTaskSemanticKey(
|
||||
): string {
|
||||
if (!task) return '';
|
||||
const rawStatus = (task as ConversationProcessingUserTask & { userStatus?: string | null }).userStatus ?? task.status_label;
|
||||
const aggregateChildren = (task.aggregateChildren || []).map((child) => ({
|
||||
workItemNo: child.workItemNo,
|
||||
intakeNo: child.intakeNo,
|
||||
status: child.userStatus ?? child.status,
|
||||
stage: child.userStage ?? child.stage,
|
||||
uploadState: child.facts?.uploadState ?? null,
|
||||
filename: child.sourceSummary?.filename ?? null,
|
||||
reason: child.blockingReason?.code ?? child.sourceSummary?.failureReasonCode ?? null,
|
||||
}));
|
||||
return JSON.stringify({
|
||||
taskNo: task.user_task_no,
|
||||
group: task.group,
|
||||
@@ -83,6 +92,7 @@ export function buildTaskSemanticKey(
|
||||
: null,
|
||||
availableActions: normalizeActionCodes(task.available_actions || []),
|
||||
canAppend: task.can_append ?? null,
|
||||
aggregateChildren,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -791,7 +801,22 @@ export function groupConversationProcessingTasks(
|
||||
export function mapShippingProcessingStatusToTaskGroup(
|
||||
item: ShippingProcessingProjection,
|
||||
): ConversationProcessingTaskGroup {
|
||||
const status = String(item.userStatus ?? item.status ?? '').trim().toLowerCase();
|
||||
const userGroup = String(item.userGroup || '').trim().toLowerCase();
|
||||
const status = normalizeLifecycleStatus(String(item.userStatus ?? item.status ?? '').trim());
|
||||
const childStatuses = (item.aggregateChildren || []).map((child) => normalizeLifecycleStatus(String(child.userStatus ?? child.status ?? '').trim()));
|
||||
const childHasFailure = childStatuses.some((value) => value === 'failed');
|
||||
const childNeedsHuman = childStatuses.some((value) => value === 'waiting_review' || value === 'manual_upload_pending' || value === 'candidate_ready');
|
||||
const childAllUploaded = childStatuses.length > 0
|
||||
&& childStatuses.every((value, index) => value === 'completed' && item.aggregateChildren?.[index]?.facts?.uploadState === 'succeeded');
|
||||
if (childHasFailure) return 'needs_action';
|
||||
if (childNeedsHuman) return 'needs_action';
|
||||
if (childAllUploaded) return 'completed';
|
||||
// 子项真实状态优先于父级 userGroup,避免 review_required/failed 被旧 processing 覆盖。
|
||||
if (status === 'failed' || status === 'waiting_review' || status === 'manual_upload_pending') return 'needs_action';
|
||||
if (userGroup === 'failed' || userGroup === 'waiting_human') return 'needs_action';
|
||||
if (userGroup === 'completed') return 'completed';
|
||||
if (userGroup === 'cancelled' || userGroup === 'archived') return 'history';
|
||||
if (userGroup === 'processing') return 'processing';
|
||||
const gateAction = String(item.primaryAction?.code ?? item.currentGate?.nextActionCode ?? '').trim().toLowerCase();
|
||||
const hasHumanAction = [gateAction, ...(item.availableActions || [])]
|
||||
.map((value) => String(value || '').trim().toLowerCase())
|
||||
@@ -859,7 +884,10 @@ export function resolveConversationProcessingFromUnified(
|
||||
// - 如果此会话/全局在此之前已见到过 order_task(2s 窗口内),
|
||||
// 则延迟回退 embedded,保持 previousProjection 不变,避免闪烁;
|
||||
// - 否则仍走 embedded,但强制 normalize 成 waiting_review。
|
||||
const hasOrderTask = items.some((item) => item.workItemType === 'order_task');
|
||||
const hasOrderTask = items.some((item) => (
|
||||
item.workItemType === 'order_task'
|
||||
|| (item.workItemType === 'order_intake' && item.sourceType === 'eml')
|
||||
));
|
||||
const convId = stabilizer?.conversationId;
|
||||
if (hasOrderTask) {
|
||||
stabilizer?.markSeen?.(convId);
|
||||
@@ -945,24 +973,27 @@ export function normalizeConversationProcessingProjection(
|
||||
}
|
||||
|
||||
/**
|
||||
* 从统一 work_items 合成 ConversationProcessingProjection(仅 order_task)。
|
||||
* 从统一 work_items 合成 ConversationProcessingProjection(order_task 与 EML order_intake)。
|
||||
*
|
||||
* 核心逻辑:order_task 工作项填充 needs_action/processing/completed;intake 不入组;
|
||||
* 核心逻辑:order_task 与 EML order_intake 均进入状态区;非 EML intake 不入组;
|
||||
* available_actions 使用标准化(去重、排序)动作码;按 previousProjection 复用旧对象引用。
|
||||
*
|
||||
* @param workItems - 统一投影 work_items
|
||||
* @param previousProjection - 上一版投影(语义稳定化复用旧对象)
|
||||
* @returns 兼容投影;无 order_task 时返回 null
|
||||
* @returns 兼容投影;无可展示任务时返回 null
|
||||
*/
|
||||
export function projectConversationProcessingFromWorkItems(
|
||||
workItems: ShippingProcessingProjection[] | null | undefined,
|
||||
previousProjection?: ConversationProcessingProjection | null,
|
||||
): ConversationProcessingProjection | null {
|
||||
const items = Array.isArray(workItems) ? workItems : [];
|
||||
const orderTasks = items.filter((row) => row.workItemType === 'order_task');
|
||||
const orderTasks = items.filter((row) => (
|
||||
row.workItemType === 'order_task'
|
||||
|| (row.workItemType === 'order_intake' && row.sourceType === 'eml')
|
||||
));
|
||||
if (!orderTasks.length) return null;
|
||||
|
||||
const rawTasks: ConversationProcessingUserTask[] = [];
|
||||
const rawTaskEntries: Array<{ task: ConversationProcessingUserTask; item: ShippingProcessingProjection }> = [];
|
||||
|
||||
for (const item of orderTasks) {
|
||||
const taskNo = String(item.workItemNo || item.rootOrderTaskNo || '').trim();
|
||||
@@ -1019,15 +1050,111 @@ export function projectConversationProcessingFromWorkItems(
|
||||
available_actions: normalizedActions,
|
||||
primary_action: gateNextAction || normalizedActions[0] || null,
|
||||
userStatus: item.userStatus ?? null,
|
||||
userStage: item.userStage ?? null,
|
||||
blockingReason: userBlocking,
|
||||
primaryAction: userPrimaryAction,
|
||||
facts: userFacts,
|
||||
userGroup: item.userGroup ?? null,
|
||||
retryable: typeof item.retryable === 'boolean' ? item.retryable : false,
|
||||
userCurrentGateCode: item.userCurrentGateCode ?? null,
|
||||
legacyStatus: item.legacyStatus ?? null,
|
||||
legacyStage: item.legacyStage ?? null,
|
||||
aggregateSummary: item.aggregateSummary ?? null,
|
||||
aggregateChildren: item.aggregateChildren ?? [],
|
||||
};
|
||||
rawTasks.push(task);
|
||||
rawTaskEntries.push({ task, item });
|
||||
}
|
||||
|
||||
const rawTasks: ConversationProcessingUserTask[] = [];
|
||||
const emlGroups = new Map<string, Array<{ task: ConversationProcessingUserTask; item: ShippingProcessingProjection }>>();
|
||||
for (const entry of rawTaskEntries) {
|
||||
if (entry.item.sourceType !== 'eml' || !entry.item.intakeNo) {
|
||||
rawTasks.push(entry.task);
|
||||
continue;
|
||||
}
|
||||
const key = String(entry.item.intakeNo).trim();
|
||||
const group = emlGroups.get(key) || [];
|
||||
group.push(entry);
|
||||
emlGroups.set(key, group);
|
||||
}
|
||||
for (const [intakeNo, entries] of emlGroups) {
|
||||
if (entries.length === 1) {
|
||||
rawTasks.push({
|
||||
...entries[0]!.task,
|
||||
aggregateChildren: entries[0]!.task.aggregateChildren?.length
|
||||
? entries[0]!.task.aggregateChildren
|
||||
: entries[0]!.item.aggregateChildren || [],
|
||||
});
|
||||
continue;
|
||||
}
|
||||
const completed = entries.filter(({ item }) => String(item.userStatus ?? item.status).toLowerCase() === 'completed').length;
|
||||
const failed = entries.filter(({ item }) => ['failed', 'retryable'].includes(String(item.userStatus ?? item.status).toLowerCase())).length;
|
||||
const needsAction = entries.filter(({ task }) => task.group === 'needs_action').length;
|
||||
const processing = entries.filter(({ task }) => task.group === 'processing').length;
|
||||
const stages = [...new Set(entries.flatMap(({ item }) => [item.userStage, item.stage].filter(Boolean).map(String)))];
|
||||
const reasonCodes = [...new Set(entries.flatMap(({ item }) => [
|
||||
item.blockingReason?.code,
|
||||
item.sourceSummary?.failureReasonCode,
|
||||
].filter(Boolean).map(String)))];
|
||||
const entryGroups = entries.map(({ task, item }) => {
|
||||
const children = item.aggregateChildren || [];
|
||||
const childStatuses = children.map((child) => normalizeLifecycleStatus(String(child.userStatus ?? child.status ?? '').trim()));
|
||||
if (childStatuses.some((value) => value === 'failed')) return 'failed';
|
||||
if (childStatuses.some((value) => value === 'waiting_review' || value === 'manual_upload_pending' || value === 'candidate_ready')) return 'waiting_human';
|
||||
if (childStatuses.length > 0 && childStatuses.every((value, index) => value === 'completed' && children[index]?.facts?.uploadState === 'succeeded')) return 'completed';
|
||||
const explicit = String(item.userGroup || '').trim().toLowerCase();
|
||||
if (explicit) return explicit;
|
||||
const status = String(item.userStatus ?? item.status ?? '').trim().toLowerCase();
|
||||
if (status === 'failed' || status === 'retryable') return 'failed';
|
||||
if (task.group === 'needs_action') return 'waiting_human';
|
||||
if (task.group === 'completed' && status === 'completed') return 'completed';
|
||||
if (task.group === 'history') return status === 'cancelled' ? 'cancelled' : 'archived';
|
||||
return 'processing';
|
||||
});
|
||||
const aggregateUserGroup = entryGroups.includes('failed')
|
||||
? 'failed'
|
||||
: entryGroups.includes('waiting_human')
|
||||
? 'waiting_human'
|
||||
: entryGroups.includes('processing')
|
||||
? 'processing'
|
||||
: entryGroups.includes('completed') && entryGroups.every((value) => value === 'completed')
|
||||
? 'completed'
|
||||
: entryGroups.includes('cancelled')
|
||||
? 'cancelled'
|
||||
: entryGroups.includes('archived')
|
||||
? 'archived'
|
||||
: 'processing';
|
||||
const group = aggregateUserGroup === 'failed' || aggregateUserGroup === 'waiting_human'
|
||||
? 'needs_action'
|
||||
: aggregateUserGroup === 'completed'
|
||||
? 'completed'
|
||||
: aggregateUserGroup === 'cancelled' || aggregateUserGroup === 'archived'
|
||||
? 'history'
|
||||
: 'processing';
|
||||
const representative = entries[0]!.task;
|
||||
const documentNames = [...new Set(entries.flatMap(({ task }) => task.document_names || []).filter(Boolean))];
|
||||
const fileCount = entries.reduce((sum, { task }) => sum + Number(task.file_count || 0), 0);
|
||||
rawTasks.push({
|
||||
...representative,
|
||||
title: representative.title || `EML ${intakeNo}`,
|
||||
display_kind: fileCount > 1 ? 'multi_document_task' : representative.display_kind,
|
||||
document_names: documentNames,
|
||||
file_count: fileCount,
|
||||
group,
|
||||
available_actions: [...new Set(entries.flatMap(({ task }) => task.available_actions || []))].sort(),
|
||||
aggregateSummary: {
|
||||
intakeNo,
|
||||
total: entries.length,
|
||||
completed,
|
||||
processing,
|
||||
needsAction,
|
||||
failed,
|
||||
stages,
|
||||
reasonCodes,
|
||||
},
|
||||
aggregateChildren: entries.flatMap(({ item }) => item.aggregateChildren || [item]),
|
||||
userGroup: aggregateUserGroup as ConversationProcessingUserTask['userGroup'],
|
||||
});
|
||||
}
|
||||
|
||||
if (!rawTasks.length) return null;
|
||||
@@ -1082,6 +1209,15 @@ export function projectConversationProcessingFromWorkItems(
|
||||
stabilizedAll.filter((t) => t.group === 'history'),
|
||||
);
|
||||
|
||||
const status_groups = {
|
||||
failed: stabilizedAll.filter((task) => task.userGroup === 'failed'),
|
||||
waiting_human: stabilizedAll.filter((task) => task.userGroup === 'waiting_human'),
|
||||
processing: stabilizedAll.filter((task) => task.userGroup === 'processing'),
|
||||
completed: stabilizedAll.filter((task) => task.userGroup === 'completed'),
|
||||
cancelled: stabilizedAll.filter((task) => task.userGroup === 'cancelled'),
|
||||
archived: stabilizedAll.filter((task) => task.userGroup === 'archived'),
|
||||
};
|
||||
|
||||
return {
|
||||
summary: {
|
||||
total_tasks: active.length,
|
||||
@@ -1097,5 +1233,6 @@ export function projectConversationProcessingFromWorkItems(
|
||||
processing,
|
||||
completed,
|
||||
history,
|
||||
status_groups,
|
||||
};
|
||||
}
|
||||
@@ -230,6 +230,29 @@ function normalizeFacts(raw: unknown): ShippingProcessingFacts | undefined {
|
||||
return out;
|
||||
}
|
||||
|
||||
function normalizeAggregateSummary(
|
||||
raw: unknown,
|
||||
): ShippingProcessingProjection['aggregateSummary'] {
|
||||
if (!raw || typeof raw !== 'object') return null;
|
||||
const item = raw as Record<string, unknown>;
|
||||
const array = (value: unknown): string[] => Array.isArray(value)
|
||||
? value.map((entry) => String(entry || '').trim()).filter(Boolean)
|
||||
: [];
|
||||
const count = (key: string): number => Number(item[key] || 0) || 0;
|
||||
const intakeNo = String(item.intake_no ?? item.intakeNo ?? '').trim();
|
||||
if (!intakeNo) return null;
|
||||
return {
|
||||
intakeNo,
|
||||
total: count('total'),
|
||||
completed: count('completed'),
|
||||
processing: count('processing'),
|
||||
needsAction: count('needs_action') || count('needsAction'),
|
||||
failed: count('failed'),
|
||||
stages: array(item.stages),
|
||||
reasonCodes: array(item.reason_codes ?? item.reasonCodes),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 题4A:规范 inventory_preparation 结构化字段(snake_case → camelCase)。
|
||||
* 注意:failed_sources 会进一步透传到 exhausted_sources 分开(二者互斥;仅 max_attempts 耗尽的源进 exhausted)。
|
||||
@@ -324,6 +347,12 @@ export function normalizeShippingProcessingProjection(
|
||||
const stageNodes = Array.isArray(stageNodesRaw)
|
||||
? stageNodesRaw.map(normalizeStageNode).filter((row): row is ShippingProcessingStageNode => Boolean(row))
|
||||
: undefined;
|
||||
const aggregateChildrenRaw = item.aggregate_children ?? item.aggregateChildren;
|
||||
const aggregateChildren = Array.isArray(aggregateChildrenRaw)
|
||||
? aggregateChildrenRaw
|
||||
.map(normalizeShippingProcessingProjection)
|
||||
.filter((entry): entry is ShippingProcessingProjection => Boolean(entry))
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
workItemType: (readString(item, 'work_item_type', 'workItemType') || 'order_task') as ShippingProcessingWorkItemType,
|
||||
@@ -368,6 +397,9 @@ export function normalizeShippingProcessingProjection(
|
||||
(item.retryable as boolean | undefined) == null ? false : Boolean(item.retryable),
|
||||
primaryAction: normalizePrimaryAction(item.primary_action ?? item.primaryAction),
|
||||
facts: normalizeFacts(item.facts),
|
||||
userGroup: readNullableString(item, 'user_group', 'userGroup') as ShippingProcessingProjection['userGroup'],
|
||||
aggregateSummary: normalizeAggregateSummary(item.aggregate_summary ?? item.aggregateSummary),
|
||||
aggregateChildren: aggregateChildren?.length ? aggregateChildren : undefined,
|
||||
legacyStatus: readNullableString(item, 'legacy_status', 'legacyStatus'),
|
||||
legacyStage: readNullableString(item, 'legacy_stage', 'legacyStage'),
|
||||
hasFormalOt:
|
||||
|
||||
@@ -311,7 +311,7 @@ describe('useShippingNoticeWorkflow', () => {
|
||||
ctl.stop();
|
||||
});
|
||||
|
||||
it('derives sibling OT tasks from work_items when embedded conversation_processing omits them', async () => {
|
||||
it('aggregates sibling EML OT work_items into one highest-attention Intake card', async () => {
|
||||
api.getShippingProcessing.mockResolvedValue({
|
||||
conversation_id: 'conv-1',
|
||||
work_items: [
|
||||
@@ -397,7 +397,12 @@ describe('useShippingNoticeWorkflow', () => {
|
||||
await Promise.resolve();
|
||||
|
||||
expect(ctl.processing.value?.needs_action.map((t) => t.user_task_no)).toEqual(['OT-ROOT']);
|
||||
expect(ctl.processing.value?.processing.map((t) => t.user_task_no)).toEqual(['OT-SIBLING']);
|
||||
expect(ctl.processing.value?.processing).toEqual([]);
|
||||
expect(ctl.processing.value?.needs_action[0]?.aggregateSummary).toMatchObject({
|
||||
intakeNo: 'SNI-1',
|
||||
total: 2,
|
||||
processing: 1,
|
||||
});
|
||||
expect(ctl.processing.value?.focused_task_no).toBe('OT-ROOT');
|
||||
expect(ctl.processing.value?.recent_task_no).toBe('OT-SIBLING');
|
||||
ctl.stop();
|
||||
|
||||
@@ -136,6 +136,80 @@ describe('useShippingOrderExtractionRuns lifecycle', () => {
|
||||
harness.runs.stopPolling();
|
||||
});
|
||||
|
||||
it('merges sibling Runs from one upload batch into one chat status card', async () => {
|
||||
const first = Object.assign(run({
|
||||
run_no: 'SNER-BATCH-1',
|
||||
conversation_id: 'conv-batch',
|
||||
intake_nos: ['SNI-BATCH-1'],
|
||||
summary: {
|
||||
total_documents: 1,
|
||||
pending_documents: 1,
|
||||
processing_documents: 0,
|
||||
completed_documents: 0,
|
||||
review_required_documents: 0,
|
||||
failed_documents: 0,
|
||||
candidate_count: 0,
|
||||
},
|
||||
documents: [{
|
||||
unit_id: 1,
|
||||
document_id: 101,
|
||||
file_name: 'notice-a.pdf',
|
||||
status: 'queued',
|
||||
line_count: 0,
|
||||
email_supplement: { status: 'none', relation_codes: [] },
|
||||
available_actions: [],
|
||||
}],
|
||||
}), { upload_batch_id: 'upload-batch-1' });
|
||||
const second = Object.assign(run({
|
||||
run_no: 'SNER-BATCH-2',
|
||||
conversation_id: 'conv-batch',
|
||||
intake_nos: ['SNI-BATCH-2'],
|
||||
summary: {
|
||||
total_documents: 1,
|
||||
pending_documents: 0,
|
||||
processing_documents: 1,
|
||||
completed_documents: 0,
|
||||
review_required_documents: 0,
|
||||
failed_documents: 0,
|
||||
candidate_count: 0,
|
||||
},
|
||||
documents: [{
|
||||
unit_id: 2,
|
||||
document_id: 102,
|
||||
file_name: 'notice-b.pdf',
|
||||
status: 'processing',
|
||||
line_count: 0,
|
||||
email_supplement: { status: 'none', relation_codes: [] },
|
||||
available_actions: [],
|
||||
}],
|
||||
}), { upload_batch_id: 'upload-batch-1' });
|
||||
api.createSubmission.mockResolvedValue({
|
||||
decision: 'created',
|
||||
user_task_no: null,
|
||||
run_no: first.run_no,
|
||||
created_new: true,
|
||||
operation_id: 'op-batch',
|
||||
});
|
||||
api.getRun.mockResolvedValue(first);
|
||||
api.listRuns.mockResolvedValue({ items: [first, second] });
|
||||
const harness = createHarness();
|
||||
|
||||
await harness.runs.startRun('', ['SNI-BATCH-1', 'SNI-BATCH-2'], [], 'upload-batch-1');
|
||||
|
||||
const cards = harness.messages.value.filter((message) => message.shipping_order_extraction_state);
|
||||
expect(cards).toHaveLength(1);
|
||||
expect(cards[0]?.shipping_order_extraction_state?.summary).toMatchObject({
|
||||
totalDocuments: 2,
|
||||
pendingDocuments: 1,
|
||||
processingDocuments: 1,
|
||||
});
|
||||
expect(cards[0]?.shipping_order_extraction_state?.documents?.map((item) => item.fileName)).toEqual([
|
||||
'notice-a.pdf',
|
||||
'notice-b.pdf',
|
||||
]);
|
||||
harness.runs.stopPolling();
|
||||
});
|
||||
|
||||
it('keeps an appended submission in the user message and the existing Run state card only', async () => {
|
||||
const queued = run({
|
||||
run_no: 'SNER-APPENDED',
|
||||
|
||||
@@ -54,6 +54,69 @@ const ACTIVE_RUN_STATUSES = new Set(['queued', 'processing']);
|
||||
const FOREGROUND_POLL_MS = 2000;
|
||||
const BACKGROUND_POLL_MS = 8000;
|
||||
|
||||
/**
|
||||
* 将同一上传批次的独立 Run 合成单张聊天状态卡。
|
||||
*
|
||||
* 核心逻辑:Run 仍按 Intake 独立执行、审计和复核;仅把同会话同 upload_batch_id
|
||||
* 的用户态摘要相加,保证一次文件选择在聊天区只出现一个卡片。
|
||||
*/
|
||||
function mergeUploadBatchRuns(primary: ShippingOrderExtractionRun, runs: ShippingOrderExtractionRun[]): ShippingOrderExtractionRun {
|
||||
const batchId = String(primary.upload_batch_id || '').trim();
|
||||
if (!batchId) return primary;
|
||||
const members = runs.filter((item) => (
|
||||
item.conversation_id === primary.conversation_id
|
||||
&& String(item.upload_batch_id || '').trim() === batchId
|
||||
));
|
||||
if (members.length <= 1) return primary;
|
||||
const activeMembers = members.filter((item) => ACTIVE_RUN_STATUSES.has(item.status));
|
||||
const status = activeMembers.some((item) => item.status === 'processing')
|
||||
? 'processing'
|
||||
: activeMembers.length > 0
|
||||
? 'queued'
|
||||
: members.some((item) => item.status === 'failed')
|
||||
? 'failed'
|
||||
: members.some((item) => item.status === 'review_required')
|
||||
? 'review_required'
|
||||
: members.some((item) => item.status === 'partially_completed')
|
||||
? 'partially_completed'
|
||||
: 'completed';
|
||||
const failedParseMembers = members.filter((item) => (
|
||||
item.documents || []
|
||||
).some((document) => document.reason_code === 'intake_parse_failed' || String(document.user_visible_stage || '') === 'parse_failed'));
|
||||
const effectiveStatus = failedParseMembers.length > 0 && activeMembers.length === 0 ? 'failed' : status;
|
||||
const summaryKeys = [
|
||||
'total_documents', 'pending_documents', 'processing_documents', 'completed_documents',
|
||||
'review_required_documents', 'failed_documents', 'cancelled_documents', 'candidate_count',
|
||||
'opened_existing_documents',
|
||||
] as const;
|
||||
const summary = summaryKeys.reduce((result, key) => {
|
||||
result[key] = members.reduce((total, item) => total + Number(item.summary?.[key] || 0), 0);
|
||||
return result;
|
||||
}, {} as ShippingOrderExtractionRun['summary']);
|
||||
const documentIds = new Set<number>();
|
||||
const documents = members.flatMap((item) => item.documents || []).filter((item) => {
|
||||
const id = Number(item.document_id || 0);
|
||||
if (id && documentIds.has(id)) return false;
|
||||
if (id) documentIds.add(id);
|
||||
return true;
|
||||
});
|
||||
const mostRecent = [...members].sort((left, right) => String(right.last_activity_at || '').localeCompare(String(left.last_activity_at || '')))[0] || primary;
|
||||
return {
|
||||
...primary,
|
||||
status: effectiveStatus,
|
||||
phase: effectiveStatus,
|
||||
intake_nos: [...new Set(members.flatMap((item) => item.intake_nos || []))],
|
||||
summary,
|
||||
documents,
|
||||
current_activity: mostRecent.current_activity || primary.current_activity,
|
||||
available_actions: [...new Set(members.flatMap((item) => item.available_actions || []))],
|
||||
handling_items: members.flatMap((item) => item.handling_items || []),
|
||||
health_tips: members.flatMap((item) => item.health_tips || []),
|
||||
progress_version: Math.max(...members.map((item) => Number(item.progress_version || 0))),
|
||||
last_activity_at: mostRecent.last_activity_at || primary.last_activity_at,
|
||||
};
|
||||
}
|
||||
|
||||
/** 按页面可见性选择轮询间隔;后台放慢,失败退避另算。 */
|
||||
function resolvePollIntervalMs(failureCount = 0): number {
|
||||
if (failureCount > 0) {
|
||||
@@ -72,6 +135,7 @@ export function mapOrderExtractionRunToMessageState(run: ShippingOrderExtraction
|
||||
userTaskNo: run.user_task_no || null,
|
||||
submissionOrdinal: run.submission_ordinal ?? null,
|
||||
composerContextId: run.composer_context_id || null,
|
||||
uploadBatchId: run.upload_batch_id || null,
|
||||
runNo: run.run_no,
|
||||
sourceRunNo: run.reparse?.source_run_no || null,
|
||||
supersedingRunNo: run.reparse?.superseding_run_no || null,
|
||||
@@ -110,6 +174,20 @@ export function mapOrderExtractionRunToMessageState(run: ShippingOrderExtraction
|
||||
lastActivityAt: run.current_activity.last_activity_at || null,
|
||||
}
|
||||
: null,
|
||||
documents: Array.isArray(run.documents)
|
||||
? run.documents.map((item) => ({
|
||||
unitId: Number(item.unit_id || 0),
|
||||
documentId: Number(item.document_id || 0),
|
||||
intakeId: item.intake_id != null ? Number(item.intake_id || 0) || null : null,
|
||||
documentType: item.document_type || null,
|
||||
fileName: item.file_name || null,
|
||||
status: String(item.status || ''),
|
||||
userVisibleStage: item.user_visible_stage || null,
|
||||
reasonCode: item.reason_code || null,
|
||||
explainability: item.explainability ? { message: item.explainability.message || null } : null,
|
||||
emailSupplement: item.email_supplement ? { status: item.email_supplement.status || null } : null,
|
||||
}))
|
||||
: [],
|
||||
selectionPlan: run.selection_plan
|
||||
? {
|
||||
selectionVersion: run.selection_plan.selection_version || null,
|
||||
@@ -218,6 +296,22 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
return composerContextId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取同批次兄弟 Run 后生成聊天展示快照。
|
||||
*
|
||||
* 仅在服务端已返回 upload_batch_id 时查询;旧 Run 或重识别 Run 保持原有单卡逻辑。
|
||||
*/
|
||||
const loadDisplayRun = async (run: ShippingOrderExtractionRun): Promise<ShippingOrderExtractionRun> => {
|
||||
if (!String(run.upload_batch_id || '').trim()) return run;
|
||||
try {
|
||||
const response = await listWorkspaceShippingOrderExtractionRuns(run.conversation_id, 100);
|
||||
return mergeUploadBatchRuns(run, response.items || []);
|
||||
} catch {
|
||||
// 聚合读失败时宁可显示本 Run 的真实状态,也不阻断轮询或误改业务状态。
|
||||
return run;
|
||||
}
|
||||
};
|
||||
|
||||
/** 停止当前 Run 短轮询;切会话和组件卸载时再清空 activeRunNo。 */
|
||||
const stopPolling = () => {
|
||||
if (pollTimer) clearTimeout(pollTimer);
|
||||
@@ -260,10 +354,18 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
): Promise<ChatMessage> => {
|
||||
const formId = `shipping-order-extraction-run:${run.run_no}`;
|
||||
const state = mapOrderExtractionRunToMessageState(run);
|
||||
const uploadBatchId = String(run.upload_batch_id || '').trim();
|
||||
const stateCards = options.messages.value.filter((item) => {
|
||||
if (item.role !== 'assistant') return false;
|
||||
const payload = item.payload && typeof item.payload === 'object' ? item.payload as Record<string, unknown> : {};
|
||||
return payload.formId === formId || payload.order_extraction_run_no === run.run_no;
|
||||
const cardBatchId = String(
|
||||
payload.shipping_order_extraction_upload_batch_id
|
||||
|| item.shipping_order_extraction_state?.uploadBatchId
|
||||
|| '',
|
||||
).trim();
|
||||
return payload.formId === formId
|
||||
|| payload.order_extraction_run_no === run.run_no
|
||||
|| Boolean(uploadBatchId && cardBatchId === uploadBatchId);
|
||||
});
|
||||
let message = stateCards.find((item) => {
|
||||
const payload = item.payload && typeof item.payload === 'object' ? item.payload as Record<string, unknown> : {};
|
||||
@@ -287,6 +389,7 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
message.payload = {
|
||||
formId,
|
||||
order_extraction_run_no: run.run_no,
|
||||
shipping_order_extraction_upload_batch_id: run.upload_batch_id || null,
|
||||
shipping_order_extraction_state: state,
|
||||
order_extraction_reparse: run.reparse || null,
|
||||
shipping_order_extraction_review: reviewAttachments || [],
|
||||
@@ -386,18 +489,20 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
const request = createRequestController(generation);
|
||||
const run = await getWorkspaceShippingOrderExtractionRun(runNo, request.signal).finally(request.release);
|
||||
if (generation !== pollGeneration || activeRunNo !== runNo) return;
|
||||
const displayRun = await loadDisplayRun(run);
|
||||
if (generation !== pollGeneration || activeRunNo !== runNo) return;
|
||||
pollFailureCount = 0;
|
||||
setRunRefreshFailed(run.run_no, false);
|
||||
if (!ACTIVE_RUN_STATUSES.has(run.status)) {
|
||||
const reviewAttachments = await refreshTerminalFacts(run);
|
||||
setRunRefreshFailed(displayRun.run_no, false);
|
||||
if (!ACTIVE_RUN_STATUSES.has(displayRun.status)) {
|
||||
const reviewAttachments = await refreshTerminalFacts(displayRun);
|
||||
if (generation !== pollGeneration || activeRunNo !== runNo) return;
|
||||
stopPolling();
|
||||
await upsertRunMessage(run, reviewAttachments);
|
||||
await acknowledgeTerminalRunWhenVisible(run);
|
||||
await upsertRunMessage(displayRun, reviewAttachments);
|
||||
await acknowledgeTerminalRunWhenVisible(displayRun);
|
||||
return;
|
||||
}
|
||||
await upsertRunMessage(run);
|
||||
await acknowledgeTerminalRunWhenVisible(run);
|
||||
await upsertRunMessage(displayRun);
|
||||
await acknowledgeTerminalRunWhenVisible(displayRun);
|
||||
if (generation !== pollGeneration || activeRunNo !== runNo) return;
|
||||
pollTimer = setTimeout(() => void pollRun(run.run_no, generation), resolvePollIntervalMs(0));
|
||||
} catch {
|
||||
@@ -456,7 +561,8 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
focused_user_task_no: focusedUserTaskNo,
|
||||
});
|
||||
// 统一提交只返回决策摘要;再拉 Run 投影供状态卡与轮询。
|
||||
const run = await getWorkspaceShippingOrderExtractionRun(submission.run_no);
|
||||
const submittedRun = await getWorkspaceShippingOrderExtractionRun(submission.run_no);
|
||||
const run = await loadDisplayRun(submittedRun);
|
||||
if (!options.conversationId.value) {
|
||||
options.conversationId.value = run.conversation_id;
|
||||
composerBoundConversationId = run.conversation_id;
|
||||
@@ -487,7 +593,7 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
await options.onConversationResolved(run.conversation_id);
|
||||
options.onWorkflowRefresh?.();
|
||||
if (ACTIVE_RUN_STATUSES.has(run.status)) {
|
||||
beginPolling(run.run_no, 1000);
|
||||
beginPolling(submittedRun.run_no, 1000);
|
||||
} else {
|
||||
const reviewAttachments = await refreshTerminalFacts(run);
|
||||
await upsertRunMessage(run, reviewAttachments);
|
||||
@@ -524,7 +630,8 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
const normalizedRunNo = String(runNo || '').trim();
|
||||
if (!normalizedRunNo) return false;
|
||||
try {
|
||||
const run = await getWorkspaceShippingOrderExtractionRun(normalizedRunNo);
|
||||
const fetchedRun = await getWorkspaceShippingOrderExtractionRun(normalizedRunNo);
|
||||
const run = await loadDisplayRun(fetchedRun);
|
||||
setRunRefreshFailed(run.run_no, false);
|
||||
if (!ACTIVE_RUN_STATUSES.has(run.status)) {
|
||||
const reviewAttachments = await refreshTerminalFacts(run);
|
||||
@@ -533,7 +640,7 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
return true;
|
||||
}
|
||||
await upsertRunMessage(run);
|
||||
if (activeRunNo !== run.run_no || !pollTimer) beginPolling(run.run_no, FOREGROUND_POLL_MS);
|
||||
if (activeRunNo !== fetchedRun.run_no || !pollTimer) beginPolling(fetchedRun.run_no, FOREGROUND_POLL_MS);
|
||||
return true;
|
||||
} catch (error) {
|
||||
setRunRefreshFailed(normalizedRunNo, true);
|
||||
@@ -662,15 +769,16 @@ export function useShippingOrderExtractionRuns(options: UseShippingOrderExtracti
|
||||
const latest = items[0];
|
||||
if (!latest) return;
|
||||
activeRunNo = latest.run_no;
|
||||
const reviewAttachments = ACTIVE_RUN_STATUSES.has(latest.status)
|
||||
const displayRun = mergeUploadBatchRuns(latest, items);
|
||||
const reviewAttachments = ACTIVE_RUN_STATUSES.has(displayRun.status)
|
||||
? undefined
|
||||
: await refreshTerminalFacts(latest);
|
||||
: await refreshTerminalFacts(displayRun);
|
||||
if (options.conversationId.value !== conversationId) return;
|
||||
await upsertRunMessage(latest, reviewAttachments);
|
||||
await acknowledgeTerminalRunWhenVisible(latest);
|
||||
await upsertRunMessage(displayRun, reviewAttachments);
|
||||
await acknowledgeTerminalRunWhenVisible(displayRun);
|
||||
options.onWorkflowRefresh?.();
|
||||
if (options.conversationId.value !== conversationId) return;
|
||||
if (ACTIVE_RUN_STATUSES.has(latest.status)) {
|
||||
if (ACTIVE_RUN_STATUSES.has(displayRun.status)) {
|
||||
beginPolling(latest.run_no, 1000);
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in new issue
Block a user