fix(report): persist longform appendix on self-hosted upsert (BUG-576)
Engine calls already returned markdown; the worker failed because local postgres upsert required onConflict and the appendix write omitted it. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8918,4 +8918,20 @@
|
||||
- 复发自:无
|
||||
- 修复版本:`1ded6bb0`
|
||||
|
||||
## BUG-576 | MD-only 长报告引擎 200 后附录 upsert 未带冲突键,staging 三次重试仍 failed
|
||||
|
||||
- 状态:resolved
|
||||
- 首次发现:2026-09-07
|
||||
- 最近更新:2026-09-07
|
||||
- 影响面:`generatePersonalReportLongform`、`personal_report_longform_appendices`、自托管 `createLocalPostgresDataClient` upsert、报告详情失败态
|
||||
- 用户现象:personal_full MD-only 首次真实运行在引擎调用阶段失败(`calculation_unavailable`,`progressPercent=30`)。直连引擎同形虚构盘 HTTP 200。
|
||||
- 触发条件:staging 自托管 web worker 调用 `/api/professional_report_reference` 成功后写入 longform 附录。
|
||||
- 根因:本地 postgres 客户端的 `upsert` 必填 `onConflict`;附录写入只调用 `.upsert(row)`。请求在写库前抛错,附录表 0 行。Job 三次尝试均打到引擎(三次 HTTP 200,约 26–32s,低于 180s 超时)。不是 api 容器滞后,也不是引擎超时。web 容器 docker logs 几乎只有启动行,附录错误码此前也不在详情 API 中。
|
||||
- 修复:附录 upsert 显式 `onConflict: "report_id"`;本地客户端缺省冲突键回落到主键;详情失败态透出 `appendixLastErrorCode` 与可读原因;引擎调用记录 `http_status`/`duration_ms`;api 容器与 `/api/health` 暴露构建 SHA。
|
||||
- 验证:定向 frontend 单测、附录 `test:db` upsert 无 `onConflict`、health/compose 源合同。未改 `.gitea/workflows/**`,不提升 main。
|
||||
- 防复发:自托管 upsert 必须能在缺 `onConflict` 时按主键执行;附录写入必须带 PK 冲突键;失败详情必须带附录错误码。
|
||||
- 相关记录:BUG-574
|
||||
- 复发自:无
|
||||
- 修复版本:待提交
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user