fix(stats): ensure accurate transfer red-packet and call counts in detail panels

This commit is contained in:
tisonhuang
2026-03-04 17:28:03 +08:00
parent 580242b9d2
commit bb602af750
7 changed files with 111 additions and 42 deletions

View File

@@ -925,7 +925,7 @@ function ChatPage(_props: ChatPageProps) {
window.electronAPI.chat.getSessionDetailExtra(normalizedSessionId),
window.electronAPI.chat.getExportSessionStats(
[normalizedSessionId],
{ includeRelations: false, allowStaleCache: true }
{ includeRelations: false, forceRefresh: true, preferAccurateSpecialTypes: true }
)
])
@@ -983,7 +983,7 @@ function ChatPage(_props: ChatPageProps) {
try {
const relationResult = await window.electronAPI.chat.getExportSessionStats(
[normalizedSessionId],
{ includeRelations: true, allowStaleCache: true }
{ includeRelations: true, forceRefresh: true, preferAccurateSpecialTypes: true }
)
if (requestSeq !== detailRequestSeqRef.current) return
@@ -1007,7 +1007,7 @@ function ChatPage(_props: ChatPageProps) {
try {
const freshResult = await window.electronAPI.chat.getExportSessionStats(
[normalizedSessionId],
{ includeRelations: true, forceRefresh: true }
{ includeRelations: true, forceRefresh: true, preferAccurateSpecialTypes: true }
)
if (requestSeq !== detailRequestSeqRef.current) return
if (freshResult.success && freshResult.data) {

View File

@@ -3499,7 +3499,7 @@ function ExportPage() {
window.electronAPI.chat.getSessionDetailExtra(normalizedSessionId),
window.electronAPI.chat.getExportSessionStats(
[normalizedSessionId],
{ includeRelations: false, allowStaleCache: true }
{ includeRelations: false, forceRefresh: true, preferAccurateSpecialTypes: true }
)
])
@@ -3549,7 +3549,7 @@ function ExportPage() {
try {
const freshResult = await window.electronAPI.chat.getExportSessionStats(
[normalizedSessionId],
{ includeRelations: refreshIncludeRelations, forceRefresh: true }
{ includeRelations: refreshIncludeRelations, forceRefresh: true, preferAccurateSpecialTypes: true }
)
if (requestSeq !== detailRequestSeqRef.current) return
if (freshResult.success && freshResult.data) {
@@ -3591,7 +3591,7 @@ function ExportPage() {
try {
const relationResult = await window.electronAPI.chat.getExportSessionStats(
[normalizedSessionId],
{ includeRelations: true, allowStaleCache: true }
{ includeRelations: true, forceRefresh: true, preferAccurateSpecialTypes: true }
)
if (requestSeq !== detailRequestSeqRef.current) return
@@ -3615,7 +3615,7 @@ function ExportPage() {
try {
const freshResult = await window.electronAPI.chat.getExportSessionStats(
[normalizedSessionId],
{ includeRelations: true, forceRefresh: true }
{ includeRelations: true, forceRefresh: true, preferAccurateSpecialTypes: true }
)
if (requestSeq !== detailRequestSeqRef.current) return
if (freshResult.success && freshResult.data) {

View File

@@ -242,7 +242,7 @@ export interface ElectronAPI {
}>
getExportSessionStats: (
sessionIds: string[],
options?: { includeRelations?: boolean; forceRefresh?: boolean; allowStaleCache?: boolean }
options?: { includeRelations?: boolean; forceRefresh?: boolean; allowStaleCache?: boolean; preferAccurateSpecialTypes?: boolean }
) => Promise<{
success: boolean
data?: Record<string, {