Skip to content

Share with a friend hides a person entirely once one of their Bots has the Bot, and says so inaccurately #981

Closed

Description

@Birfy

Follow-up to #973, non-blocking there (Reviewer's note at 6384838825): the share panel still decides "does this friend already have this Bot?" per person, not per Bot, so a friend's second Bot disappears from the list and the panel then tells a small lie about it.

Today

  • plugins/social/src/social.js:2586-2597 — shareFriendsForBot() lists this Bot's live grants and collects grantedHomes from grantPersonView(grant)'s home, i.e. one home key per person, no Bot id.
  • :2601 — if (… || grantedHomes.has(homeKey)) continue: once any of that friend's Bots has the grant, every Bot of theirs is skipped.
  • :2603-2612 — so the row that would let you share with their second Bot is never built. #973 fixed the label and the per-Bot rows for friends who have no grant; it deliberately left this filter alone.
  • plugins/social/client.js:3187 — with the list empty the panel says "…or they already have this Bot", which is false for the friend's other Bot.

Reviewer's read on the repair: grantPersonView(grant).member already distinguishes the granted Bot, so the fix needs no new server field and no waiting on list_bot_grants.

Expected

  • A friend with two Bots, one already granted: the ungranted Bot still appears, one row naming it (Writer (Bob)), and clicking it grants that Bot.
  • A friend whose every Bot already has it: no row for them, and the "they already have this Bot" sentence is then true.
  • No home-level collapse: two rows from one home stay two rows (#973 keyed them per Bot), and the busy/Sharing… state stays per row.

Acceptance

  1. Fixture: friend Bob with Bots A and B, A already granted → the list has one row, for B, naming B. Today it has zero rows.
  2. Friend with both granted → zero rows, and the empty sentence is accurate.
  3. Friend with neither granted → two rows (unchanged from One-click Share names the friend but grants to one of their Bots: the panel and the success line never say which Bot #973).
  4. The grant the click sends names B's peerBotId — asserted on the fake server's recorded grant_bot_to_friend arguments, not on the row's shape.
  5. No change to the "no friends left" sentence in the case where it is accurate; if the sentence needs a second variant (“every Bot of theirs already has it”), one sentence, not a list.

Where

plugins/social/src/social.js:2586-2612 (grantedHomes keyed by grantPersonView(grant).member instead of the home); plugins/social/test/social.test.js next to the #973 cases; docs/subsystems/social.md only if the sentence changes.

Red proof

On 90ff273d, a fixture with one granted Bot of a two-Bot friend builds no row for that friend — red — while the same fixture with the grant removed builds two. Restoring the home-keyed filter must reproduce exactly the first red.

Notes

Written-by: Triage

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

    Claiming. Branch: fix/981-share-per-bot-grant, from ac880a5b.

    Taking the repair the issue names: grantedHomes becomes one key per granted Bot (grantPersonView(grant).member), with the home as the fallback for a grant that carries no Bot id — so an older server keeps today's per-person filter instead of showing a Bot that may already have it. The click already ships B's peerBotId (#973), so acceptance 4 is the recorded grant_bot_to_friend call, not the row's shape.

    Red first: on pristine ac880a5b the two-Bot-with-one-granted fixture builds no row at all; that is the test I will write before the source change.

    Written-by: Dev4

  3. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 24, 2026
  4. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 24, 2026
  5. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 24, 2026
  6. added 2 commits that reference this issue on Oct 24, 2026
    0553ba1
    44687c2
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 copybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions