Skip to content

Room approval card can show "Waiting for the owner's approval" with no buttons while the approval is already pending #1607

Closed

Description

@Birfy

Written-by: Chief

环境(取证时)

Reproduce

  1. 在房内输入框发一行,产生 hold。
  2. 某一刻卡面是 Waiting for the owner's approval、没有 Approve / Reject 按钮。
  3. 同一时刻 flybot/social/approvals 里该条目已经是 pending、approvalId 有值;再过约 1 秒(下一轮 5s 轮询后)按钮出现,可以正常批。

Expected

有属于本 home 的 pending approval 时,卡片直接给按钮;不确定时用中性的加载态。「等待 owner 批准」是在陈述一个假事实——没有任何人在等,就是自己这台机器。

Actual

plugins/social/client.js:2425 的 waitingOthers = mine.length === 0 && (room?.pendingCount ?? 0) > 0 用上一轮快照判定;approval 列表 5s 轮询落后一拍时,本 home 自己的 pending 会先被画成「别人的卡」——canDecide:false 的空卡。

Scope

plugins/social/client.js 的房内审批卡等待态判定(是否引入本地 pending 计数 / 缩短或用事件驱动刷新)。

Needed before agent-ready

轻量竞态,不挡批准也不挡拒绝,单次观测。要一份确定性复现(把轮询对齐到卡片出现的那一刻,或注入一次 list 延迟),确认根因是快照落后而不是 pendingCount 语义本身。

Activity

  1. added
    bugSomething isn't working
    needs-infoWaiting for the reporter or a maintainer decision
    area:socialFriends, invites, grants, Bot Social
    area:uiWeb/desktop UI and copy
    self-testFiled by the product self-test routine (issues only)
    on Oct 28, 2026
  2. Birfy commented on Oct 29, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    agent-ready — 三条判据都过:设计上无未决(期望就是「本 home 的 pending 到了就给按钮,拿不准画中性态」),范围是一个客户端文件,不是 hold/tracking/组间。

    要改的文件:plugins/social/client.js — ChatApprovalDock 里的 waitingOthers(当前 2425 行)和它画出的无按钮分支(2466-2470 行)。根因不是 pendingCount 的语义,而是两路数据不同步:items(social/status)与 local(social/approvals)各自加载,5s 轮询落后一拍时 mine.length === 0,而 room.pendingCount > 0 只说明「这间房有卡」,不能证明卡属于别人。改法在同一文件内二选一:waitingOthers 只在本 home 的审批列表已经答过一次、且其中确无本房条目时才成立;或者删掉这个分支,等轮询到达再画按钮。服务端不动。

    验收命令(新测试 plugins/social/test/approval-dock.test.js):

    cd plugins/social
    node --import ./test/resolve.mjs --test test/approval-dock.test.js
    npm test

    红先怎么写:照 plugins/social/test/web-entry.test.js 的办法加载 client.js(new Function('window', 源码) 截获 __ModuleLoader__ 的 factory,fake react 用 core/test/approval-waiting.test.js 里那套带 hook 槽位的 stub),拿到导出的 ChatApprovalDock。把 globalThis.__flybot__.call 固定成:social/status → { approvals: [] };approvals → 一个先不 resolve 的 Promise(注入列表延迟);room → { id: 'r1', origin: 'face-to-face', pendingCount: 1 }。断言首帧树里没有 Waiting for the owner's approval,也没有 data-flybot: 'chat-approvals' 的无按钮卡——当前代码在首帧就会画(2425 → 2466),这条先红;改完转绿。再加一条断言:本 home 的 pending 项放进 hook 槽位后,卡片出现 Approve/Reject。

    不动:服务端、hold 语义、审批状态机。

  3. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    and removed
    needs-infoWaiting for the reporter or a maintainer decision
    on Oct 29, 2026
  4. HugoXK commented on Oct 29, 2026

    @HugoXK
    Contributor

    Claim

    Written-by: FlyBot Lead
    Claimed-by: FlyBot Lead
    Claim-Id: bb01226f69d74a52b1cf3c44b55b632f
    Branch: dev/1607-room-approval-card-can-show-waiting-for
    Base: 63f07ef
    At: 2026-10-29T02:31:47Z

  5. HugoXK commented on Oct 29, 2026

    @HugoXK
    Contributor

    Heartbeat

    Written-by: FlyBot Lead
    Still-working: bb01226f69d74a52b1cf3c44b55b632f
    At: 2026-10-29T02:46:46Z

  6. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 29, 2026
  7. HugoXK commented on Oct 29, 2026

    @HugoXK
    Contributor

    Release

    Written-by: FlyBot Lead
    Released: bb01226f69d74a52b1cf3c44b55b632f
    Reason: merged as #1623 (8f6e60c); issue closed 04:19:22Z
    At: 2026-10-29T04:29:14Z

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

    area:socialFriends, invites, grants, Bot Socialarea:uiWeb/desktop UI and copybugSomething isn't workingself-testFiled by the product self-test routine (issues only)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions