Skip to content

[高] 反馈 comment 文本被接受后直接丢弃,保存了也无处可查 #21

Open

Description

@xiaoyao-666-coder

现象(main 上实测)

comment 全链路只被当布尔值用:内存版 if comment and previous is None: feedback["commented"] += 1(backend/app/metrics.py:107-108),Redis 版只传 "1"/"0"。实测 500 字 comment 提交返回 200 {"accepted":true,"changed":true},但 /api/metrics 快照里只有 feedback: {up, down, commented: 1},文本无处可查。更严重:先无 comment 投 up,再同分带 comment 重投,返回仍是 200 accepted:true changed:false,commented 计数不变——接口声称接受,comment 却被静默丢掉。

相关位置:backend/app/main.py:203-207(comment: max_length=500)、main.py:1328-1332、backend/app/metrics.py:78-108、backend/app/infra.py:140(_UPSERT_FEEDBACK_SCRIPT)、infra.py:531-554。

与 PR #16 的关系

PR #16(fix #9 分支,未合并)已修一半:内存版把最新 comment 文本存在 _feedback_comments 里,同分带新 comment 重投会返回 changed;Redis 版只存 comment 的哈希用于判重,不存原文。但两个后端都没有任何接口能把 comment 读回来,存了也查不到。所以本 issue 剩下的是“存了但没地方查”:要么提供读取/导出途径,要么明确不接收 comment 字段。

预期

要么不接收 comment 字段,要么存下来并可查;已接受的文本不应丢失。

第二轮测试(2026-11-16,上游 main 3f82d20)发现。

Activity

  1. added 2 commits that reference this issue on Nov 16, 2026
    ce8b006
    1ddac0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions