fix(web+health): 修复咨询轮询 temp ID 400 + 健康数据统计 500
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- ConsultationDetail: 轮询取 lastId 时过滤 temp_ 前缀的乐观消息 ID,
  避免将非法 UUID 传给 after_id 参数导致后端 400
- stats_service: count_abnormal_lab_items 和 compute_daily_report_rate
  中 SQL 字面量 0 类型为 INT4,与 Rust i64 (INT8) 不匹配,
  改为 0::bigint 确保类型兼容
This commit is contained in:
iven
2026-04-30 12:27:56 +08:00
parent 1bebb57765
commit 84fafb0bc5
2 changed files with 4 additions and 3 deletions

View File

@@ -120,7 +120,8 @@ export default function ConsultationDetail() {
pollRef.current = setInterval(async () => {
if (!sessionId) return;
try {
const lastId = messages.length > 0 ? messages[messages.length - 1].id : undefined;
const realMsgs = messages.filter((m) => !m.id.startsWith('temp_'));
const lastId = realMsgs.length > 0 ? realMsgs[realMsgs.length - 1].id : undefined;
const result = await consultationApi.listMessages(sessionId, {
page: 1,
page_size: 50,