buzz icon indicating copy to clipboard operation
buzz copied to clipboard

New channel: Desktop @ picker lags after invite; Mobile has no invite for people/agents

Open vesc-vesc opened this issue 3 months ago • 1 comments

Bug Description

On a self-hosted community with a remotely hosted agent (not managed on the mentioner's Desktop install):

  1. Desktop: creating a channel and inviting the agent now works, but the composer @ picker does not list that agent immediately after the invite. After a short wait, the same picker starts showing the agent and mentions work.
  2. Mobile: channel create works, but there is still no UI to invite a person or an agent into that channel. @ mentions still work.

These look like two membership-surface gaps around the same job: add someone to a new channel, then address them.

Steps to Reproduce

Desktop — picker lag after invite

  1. Create a new channel on Desktop.
  2. Invite a remotely hosted agent into that channel (this step itself now succeeds; it previously did not).
  3. Open the composer in that channel and type @.

Mobile — no invite

  1. Create a new channel on Mobile.
  2. Look for a control to invite a person or an agent.

Expected Behavior

  • Desktop: as soon as the invite succeeds, the invited agent (and invited people) appear in that channel's @ picker. No extra wait / restart should be required.
  • Mobile: after creating a channel, the same invite-people / invite-agent action Desktop has should exist.

Actual Behavior

  • Desktop: invite succeeds, but @ does not list the agent at first. After some time (no other action reported), the agent appears in the picker and can be mentioned.
  • Mobile: channel create succeeds. There is no invite for people or agents. Mentions still work.

Environment

  • Date: 2026-08-20
  • Surfaces: Buzz Desktop (Nest) and Buzz Mobile
  • Topology: self-hosted community; agent runtime on a different machine from the mentioner's Desktop
  • Local reference host (not necessarily the mentioner's Desktop): Buzz.app 0.5.17

Exact mentioner Desktop / Mobile build numbers were not captured in this report. Happy to add them in a comment.

Additional Context

Adjacent, not a duplicate of the older “picker hides cross-owned agents” cluster:

  • https://github.com/block/buzz/issues/3125
  • https://github.com/block/buzz/issues/2508
  • https://github.com/block/buzz/issues/3277
  • https://github.com/block/buzz/issues/3204

Those were “agent never appears in Desktop @.” This report is: invite to a new channel is now possible on Desktop, then membership/picker is stale for a while; Mobile still cannot invite at all, even though mentions work.

Please omit asking for community URL / channel UUID in public comments; repro is the membership + picker surfaces above.

vesc-vesc avatar Aug 20 '26 07:08 vesc-vesc

Current main review separates these into one likely stale-cache bug and one already-merged surface:

Desktop: useAddChannelMembersMutation invalidates channel list/detail/member queries, but it does not invalidate relayAgentsQueryKey. Composer admission for a remote agent is derived from useRelayAgentsQuery() and requires that record’s relay-derived channelIds to contain the active channel. The native directory rebuilds those channel ids from kind:39002 membership events. After a successful generic invite, the member query refreshes but the relay-agent directory remains cached until its later refresh. That matches “invite succeeds, picker appears after a wait.” The managed-agent attach path already invalidates the agent queries; the generic add-member path does not.

The narrow Desktop fix is to invalidate relayAgentsQueryKey after a successful added bot/member mutation, with one focused regression proving the composer sees the invited remote agent immediately through the production mutation/cache composition. An optimistic update would be riskier because the directory is the authorization backstop; refetching it preserves fail-closed behavior.

Mobile: PR #6113 merged 2026-08-19 and current main now exposes Add members in channel details. AddChannelMembersSheet explicitly searches “people or agents” and publishes through channelActionsProvider.addMembers. The reported mobile build likely predates that merge or release. Please retest on a build containing #6113 before adding a second mobile implementation.

I have not opened a Desktop PR yet because this repository requires a regression for bug fixes, and the local contributor rule for this effort requires explicit approval before adding even a focused core test.

ScaleLeanChris avatar Aug 20 '26 15:08 ScaleLeanChris