Skip to content

The group strip's read has no failure branch in the suite: a host without room-invite could lose its only invite entry without a red test #1046

Closed

Description

@Birfy

Owner: Dev4

What is missing

The group strip's read has a failure branch that nothing exercises. In plugins/social/client.js the read effect is:

useEffect(() => {
  if (blank !== true || !roomId || room?.face) return undefined
  let gone = false
  host('room-invite', { roomId }).then((value) => {
    if (gone) return
    setShown({ roomId, invite: liveInviteOf(value) })
    setRead({ roomId, done: true })
  }, () => { if (!gone) setRead({ roomId, done: true }) })
  return () => { gone = true }
}, [blank, roomId, room?.face ? 'face' : ''])

The second callback (host rejects) is the only thing that lets Invite by link appear when the route is not there at all — an older host, or a route that answers with an error. known is read.roomId === roomId && read.done, so if that branch stopped setting done, the panel would draw the group name and members but no invite entry at all, on every such host, and the suite would stay green: every existing case (#998, #1019, #1038) answers the read successfully.

That is a silent loss of the only way to invite from the strip, i.e. exactly the state #998 existed to fix, reachable again without a red test.

Suggested shape

One case in the existing mini-renderer in plugins/social/test/social.test.js: a blank local group whose host('room-invite', ...) rejects. Assert the button renders, that clicking it calls room-invite-mint exactly once, and that the read happened once. Red without the failure branch (drop done: true there → the button never renders).

Found while landing #1038 (PR #1040); Reviewer raised it as non-blocking in the PASS comment.

Activity

  1. added
    enhancementNew feature or request
    area:socialFriends, invites, grants, Bot Social
    area:uiWeb/desktop UI and copy
    on Oct 25, 2026
  2. Birfy commented on Oct 25, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Triage at main 1d5b5a5f: accepted — this is the issue for that gap, and #1047 (I filed it 50 s later, same gap) is closed as a duplicate of this one. Adding the acceptance I wrote there so the branch has a fixed target.

    Code under test, plugins/social/client.js GroupStrip: the reject handler of the room-invite read sets read.done (:2199), which is the only reason the button appears on an older host; the button itself is drawn only when known (:2231).

    Acceptance:

    1. With room-invite rejecting: [data-flybot=group-strip-invite] exists after the read settles, and no room-invite-mint call happens by itself.
    2. One click calls room-invite-mint exactly once and shows the minted URL.
    3. No error note is rendered for the read failure (the strip behaves as if the room had no link).
    4. Knife: leave read.done false in the reject handler → case 1 goes red; the rest stay green.

    Test-only: no changelog.d/ fragment; Docs-not-needed: in the commit message if arch-docs fires. Owner: Dev4, agent-ready.

  3. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 25, 2026
  4. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 25, 2026
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 copyenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions