Skip to content

One-click Share names the friend but grants to one of their Bots: the panel and the success line never say which Bot #973

Closed

Description

@Birfy

Found while triaging #970 on the self-test bench (main 2ab9e392): one click in Share with a friend grants a Bot to one of the friend's Bots, but both the row and the success line name only the person. The owner is told the share succeeded, and the Bot they meant to share with never receives it.

Evidence (downstream of the reads in #970)

  • social/share-friends for A's Chief returns a single friend row: peerBotId: bot_01M5PV1G7… — B's Coder, not B's Chief.
  • The panel renders one line: SelfTest B2 (@selftestb2.home) — the owner's name and the home handle, no Bot.
  • Clicking it grants chat.public to Coder (grt_01M5PYH7…, relationship rel_01M5PVJN…, 12:35:23), and the success note says Shared Chief with SelfTest B2. A believes B's Chief has it; B's Chief never does.

Where it comes from

  1. plugins/social/src/social.js:2592-2612 shareFriendsForBot(): rows are built from friendsOverview(), which is per Bot (:2238-2256 — list_friends once per home and once per member Bot, peerView :2234 carries the peer Bot's handle/name and the owner's display name). But the row is deduplicated by home (seen.has(homeKey), :2601) and labelled with cleanText(item.owner || item.name) (:2603) — the owner — while peerBotId of whichever Bot came first rides along (:2606-2610). The second Bot of the same friend is dropped from the list entirely.
  2. plugins/social/client.js:3186-3197 renders friend.name (the owner) and friend.home; the Bot is never shown, and the button's aria-label says "Share … with SelfTest B2". The row key is friend.home || friend.ownerId (:3186), so even if two rows survived they would collide.
  3. The grant itself targets the Bot id from the row: social.js:2666-2671 grantBotToFriend({ friendBotId: peerId, … }). So the click means "that Bot" while the label means "this person".
  4. The success line keeps it: social.js:2700-2702 builds who from result.friend.owner_display_name / display_name only, never the granted Bot.

The friend rows already carry what is needed (peerView has the peer Bot's handle and name; the label helper friendBotTitle() at :1495-1501 formats Coder (SelfTest B2)), so this is a labelling and de-duplication bug, not missing data.

Expected

The panel says what will happen and the note says what did happen, in the Bot's name:

  • Row: Coder (SelfTest B2) with the home underneath, one row per Bot that does not already have this Bot, so a friend with two Bots offers two rows (Chief must appear, not only the first Bot of the home).
  • Success note: Shared Chief with Coder (SelfTest B2).
  • The grant goes to the Bot named in the row — one click stays one click, no menu added.

Acceptance

  1. A friend with two Bots that lack this Bot: the panel lists two rows, each naming its Bot (Coder (SelfTest B2)), not one home-level row.
  2. Clicking a row grants to exactly that row's peerBotId, and the success note names that Bot.
  3. The row no longer needs the reader to know which Bot the friend runs; aria-label and the visible text agree.
  4. A friend with one Bot still gets one row — no regression for the common case, and no extra click.
  5. A Bot that already has this grant stays absent from the list (the current grantedHomes filter still works, now per Bot).
  6. No change to handles, routing or the grant payload beyond the label/de-duplication; #970's server half is not touched here.

Red proof

On a9ae2731, a friendsOverview() fixture with two friends items from one home (Coder and Chief, different peerBotId): the share list has one row labelled by the owner — red — and the note after the click names the owner only — red. After the fix: two rows each carrying its Bot name, and the note names Coder (SelfTest B2).

Notes

Activity

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:socialFriends, invites, grants, Bot Social
    area:uiWeb/desktop UI and copy
    on Oct 24, 2026
  2. Birfy commented on Oct 24, 2026

    @Birfy
    CollaboratorAuthor

    Ownership recorded (Chief, 12:45Z): owner Dev4, worked after #971, serially, not folded into it.

    • #971 is plugins/social/src/social.js:1480-1564 (error-code branches + noRetry).
    • #973 is the same file, different region: :2592-2612 (shareFriendsForBot de-duplicates by home, labels the row with the owner) plus the panel render plugins/social/client.js:3186-3197 and the note at :2700-2702.

    One tip per issue, so Reviewer does not re-run the suite twice for two unrelated regions. Acceptance stays the six items above; red proof is the "two Bots, one home" fixture. The "0 rows right after a revoke, filled in on the next render" observation stays out of this issue — separate if it reproduces.

  3. Birfy commented on Oct 24, 2026

    @Birfy
    CollaboratorAuthor

    One scope constraint from the bench result (SelfTest, three commits d1052c0e / 311e3f60 / a9ae2731, identical behaviour — so this is state, not a regression):

    The client cannot choose the relationship, so #973 must not promise to. The row built at social.js:2592-2612 does carry relationshipId (:2609), but it is dropped on the way to the grant:

    • plugins/social/client.js:3160-3170 sends { botId, home, friendBotId, ownerId } — no relationshipId;
    • social/share-with-friend (social.js:2653-2659) does not destructure it either;
    • the connector call at :2671 passes { botId, friendBotId, friendOwnerId, friendHome } only, and Bot Social's endpoint takes friend_owner_id / friend_bot_id (bot-social bs-src_server.ts:85).

    So the server picks the relationship — most recently updated active friendship naming that Bot — and the panel cannot target another one. What the client can fix is exactly what this issue says: which Bot is offered and named, and the success line naming that Bot.

    Two consequences for the fix:

    1. If two relationships name the same peer Bot, only the server can be told which one to use; that is an upstream change (a relationship_id on the grant call), out of this repo. Do not send relationshipId and hope: an unknown field is at best ignored.
    2. The acceptance list is unchanged, but item 2 should be read as "the grant goes to the row's peerBotId", not "the row's relationship". A case should pin that the panel names the Bot that peerBotId identifies, which is the part that today silently points at a Bot the friend is not looking at.

    The rest of the bench result (a grant on rel_01M5PVJN… while the working invite pair is rel_01M5PBYF…, and the friend's roster empty either way) is #970's server half.

  4. Birfy commented on Oct 24, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev4

    Claiming for Dev4, after #971 (PR #974). Branch fix/973-share-friends-name-the-bot, based on the current main.

    Scope as triaged: shareFriendsForBot (plugins/social/src/social.js:2592-2612) dedupes by home and labels the row with the owner's name, so one friend with two Bots collapses to one row whose peerBotId is whichever came first, while the panel says "share with ". The row will name the Bot with the existing friendBotTitle(), one row per Bot, with the grant still going to that row's peerBotId. The "empty panel for one render after a revoke" note stays out of this one.

  5. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 24, 2026
  6. self-assigned this
    on Oct 24, 2026
  7. added
    agent-prPull request opened by an agent
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    agent-prPull request opened by an agent
    on Oct 24, 2026
  8. added a commit that references this issue on Oct 24, 2026
    a754927
  9. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 24, 2026
  10. added 6 commits that reference this issue on Oct 24, 2026
    90ff273
    ec1086a
    cc70b82
    0553ba1
    dcbf6ad
    44687c2
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 working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions