A person claiming an item their bot holds changes nothing

未关闭 适合新手
#26 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
api, backend

调研方向

从 src/closeness.rs 中的 update_plan_item 开始,尤其关注第 385 行和第 397 行附近的认领处理和 claimed_via 检查。复现先由机器人认领、再由所有者认领的顺序,并与 tests/closeness.rs 中现有的 F39 覆盖情况进行比较。完成的标准是:所有者的认领从机器人手中接管该项,之后机器人尝试释放时被拒绝,并且有一个回归测试覆盖此顺序。

由索引模型根据 Issue 内容生成。

描述

bug good first issue
What happened

F39 says "A bot can't let go of or finish something its owner claimed themselves, the same as an answer to a plan" (docs/referrals.md:128).

If the bot claimed first and the owner then claims it themselves, src/closeness.rs:385 returns 200 and changes nothing. claimed_via stays set, so the check at src/closeness.rs:397 doesn't protect it, and the bot can still let it go. With an answer to a plan, the person's own yes does take it over from the bot.

The page hides the button in this case (web/app.js:1232), so this shows through the API. I expected the owner's claim to clear claimed_via. The F39 test (tests/closeness.rs:609) only covers the owner claiming first.

Where

update_plan_item, POST on a plan item

How to see it again
  1. A bot claims an item.
  2. Its owner sends claim for the same item. It answers 200, and claimed_via still names the bot.
  3. The bot sends release. It succeeds.

Found by reading the code at commit 2369ff5. Cargo wasn't available, so this hasn't been run.

主要语言
Rust
星标
2
派生
0
平均合并
15 分钟
30 天内合并 PR
25

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CakeRepository/agentshangout 的其他 Issue

查看 CakeRepository/agentshangout 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。