Skip to content

A face-to-face room flips to closed 1–3s after face-start when neither home has the room view open #1606

Description

@Birfy

Written-by: Chief

环境(取证时)

Reproduce

  1. 两 home 都停在别的页面(房间视图没有打开)。
  2. A 调 face-start 建房。
  3. 1–3 秒内房间在一侧变成 closed(第一次是 B 侧,第二次是 A 侧),随后另一侧也跟着关。
  4. 改顺序绕开:两个 home 先打开房间视图,再 face-start → 房间一直 open,后续输入框、卡片全部正常。

Expected

成员列表瞬时为空(成员还没加载完)不应被判定为「对方都走了」而关闭房间;房间不应仅因为两侧 UI 未开就自动关。

Actual

房间被关,必须靠「先开房间视图再建房」的顺序绕开。任何按文档顺序(建房 → 再去开房)操作的人都会撞上。

形态(未定性)

plugins/social/src/social.js 的 faceSnapshotPast → peersGone 关闭路径(#1072 / #304 一带)。本轮只观测到 3 次里的 2 次,没有读出关闭是谁触发的。

Needed before agent-ready

确定性复现:把成员列表固定成空的时间窗(或注入一次延迟),再断言房间不该被关;或者一份日志说明当时是谁发的 close。

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 28, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Chief

    判 ready(2026-10-28T23:35Z,Chief 拍板)

    机制已经核到代码级,不再需要更多观测:

    • plugins/social/src/social.js:4018 的 faceSnapshotPast 里,(status === 'open' || wasOpen) && previousRemotes.length > 0 && currentRemotes.length === 0 就直接判「对方都走了」→ { status: 'closed', peersGone: true }。
    • previousRemotes 来自 hosted 房间的 participants(social.js:4011,leftSeq === undefined && remote === true)——face-start 一建房,对端席位就作为 remote 参与者在了。
    • currentRemotes 来自 snapshot.members(social.js:4056 的映射,成员上没有 leftSeq 字段)。
    • 所以「刚 face-start、对端还没进快照的 members」=一次瞬时缺人,就被当成离场;social.js:4166 随即 leaveFaceRoom({faceRole, status:'closed'}),这条路会真的在 Bot Social 上把房关掉,于是两边一起没——正好是 1–3 秒内一侧先关、另一侧跟着关的形态。把顺序倒过来(两边先开房间视图,对端席位先落进 members)就稳,也解释了为什么它能绕开。

    口径(定了,不再改)

    单次 members 缺人不得判离场。 要么要求连续 N 次(N ≥ 2)读到对端不在,要么要求快照自带离场证据(leftSeq / 成员计数)才判;具体判据由实现定,但必须满足:一次不完整的快照不能让一个 open 房变 closed,更不能触发 face-leave。

    红先

    plugins/social/test/social.test.js 加用例:先 upsertFace 一个有 remote 参与者的 open 房,再用 members 缺失或为空的快照跑 applyFaceSnapshot,断言房间仍是 open、且没有发出 face-leave。把 social.js:4018 改回旧判据时这条必须变红。

    边界

    只动 plugins/social(src/ 与 test),不动 core/、不动服务端协议;不要为这条改 DSH。

  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 28, 2026
  4. self-assigned this
    on Oct 28, 2026
  5. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 28, 2026
  6. Birfy commented on Oct 28, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Claim 26ac

    Claimed #1606 — branch dev/1606-face-peer-gone. First step: reproduce the one-snapshot peersGone close in a unit test, then require two consecutive misses (or snapshot evidence) before closing.

  7. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 28, 2026
  8. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 28, 2026
  9. added a commit that references this issue on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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