feat: 导入聊天记录报错时记录更详细的日志

This commit is contained in:
digua
2026-01-23 23:34:34 +08:00
parent 5858cb0eff
commit e7fcbbce5a
7 changed files with 206 additions and 11 deletions

View File

@@ -58,6 +58,27 @@ interface FormatDiagnosisSimple {
}>
}
// 导入诊断信息
interface ImportDiagnostics {
/** 日志文件路径 */
logFile: string | null
/** 检测到的格式 */
detectedFormat: string | null
/** 收到的消息数 */
messagesReceived: number
/** 写入的消息数 */
messagesWritten: number
/** 跳过的消息数 */
messagesSkipped: number
/** 跳过原因统计 */
skipReasons: {
noSenderId: number
noAccountName: number
invalidTimestamp: number
noType: number
}
}
interface ChatApi {
selectFile: () => Promise<{
filePath?: string
@@ -70,6 +91,7 @@ interface ChatApi {
sessionId?: string
error?: string
diagnosis?: FormatDiagnosisSimple
diagnostics?: ImportDiagnostics
}>
getSessions: () => Promise<AnalysisSession[]>
getSession: (sessionId: string) => Promise<AnalysisSession | null>