补齐 AGC 错误通知重载恢复
Project CI / Repository checks (pull_request) Failing after 11s
Project CI / Backend tests (pull_request) Failing after 11s
Project CI / Frontend tests (pull_request) Failing after 2m23s
Project CI / Native shell tests (pull_request) Has been cancelled

挂载时读取 Rust 错误快照并恢复未通知事件

提交报告时移除 Rust 内部 notified 字段
This commit is contained in:
2026-09-01 19:54:09 +08:00
parent 584eabd1fd
commit 7f0d4605eb
2 changed files with 16 additions and 5 deletions
@@ -16,15 +16,23 @@ export function ErrorReportNotice() {
const loadEvents = useCallback(async (eventIds?: string[]) => {
try {
const events = await getPendingClientErrorEvents();
if (!eventIds?.length) return;
if (eventIds?.length) {
const ids = new Set(eventIds);
setNotificationEvents(events.filter((event) => ids.has(event.eventId)));
} else {
setNotificationEvents(
events.filter((event) => event.notified === false),
);
}
} catch {
// 通知失败不应打断 AGC 主流程。
}
}, []);
useEffect(() => subscribeClientErrorEvents(loadEvents), [loadEvents]);
useEffect(() => {
void loadEvents();
return subscribeClientErrorEvents(loadEvents);
}, [loadEvents]);
const openReport = () => {
setReportEvents(notificationEvents);
@@ -17,6 +17,7 @@ export type ClientErrorEvent = {
stack?: string;
occurredAt: string;
count: number;
notified?: boolean;
};
export type DiagnosticLogFile = { name: string; content: string };
@@ -181,7 +182,9 @@ export async function submitErrorReportBatch(
schemaVersion: 1,
submissionId:
globalThis.crypto?.randomUUID?.() ?? `submission-${Date.now()}`,
events: payload.events,
events: payload.events.map(
({ notified: _notified, ...event }) => event,
),
userDescription: payload.userDescription?.trim() || null,
logs: payload.logs,
}),