Skip to content

Cover room termination: a deleted room or a removed member must not be nudged by a late completion #318

Closed

Description

@hsliuustc0106

From the #198 acceptance audit: the 验收与证据 box "终止/离开的房间不得继续触发工作" had zero test coverage — the closest analog was "deleting the responsible Bot fails its open tasks".

The behavior exists in the host (verified by reading and by mutation):

  • Layer 1: turns.js ignores session events from a session that is no longer a bot session (dropGroupSession unlinks it when the room is deleted or the member removed).
  • Layer 2: lateRoomReply/lateRoomFailure re-check the room and membership before posting.
  • deleteRoom also clears the room inbox and archives the room's own session with stopActivity.

Nothing pins it. A regression in either layer would let a mid-work member's late completion restart a round in a room that no longer exists or no longer contains it.

Acceptance:

  • Same-room fixture tests: delete the room mid-work (member working, round moved on), then deliver the member's late completion — assert no followup reaches the room, the relay for the deleted room refuses (Not a group chat), and nothing dispatches.
  • Remove the member mid-work, then deliver its late completion — assert no post lands in the room log, no room nudge, lateRounds untouched.
  • Mutation-checked: removing both containment layers makes the new tests fail (single-layer removal still passes, i.e. the defense in depth is real).

Activity

  1. added a commit that references this issue on Oct 18, 2026
    c080292
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions