Skip to content

Pin the share receipt's slug guard: a label equal to the home slug must fall back to "your friend" #1008

Closed

Description

@Birfy

Owner: Dev2

What

plugins/social/src/social.js:2743-2746 (main d24c47c8) drops the click's row label and falls back to your friend when that label is the home key's slug:

const slug = homeKey ? String(homeKey).replace(/^@/, '').replace(/\.home$/i, '') : ''
const rowLabel = cleanText(friendName)
const who = (botName ? (ownerName ? `${botName} (${ownerName})` : botName) : ownerName)
  || (rowLabel && rowLabel.toLowerCase() !== slug.toLowerCase() ? rowLabel : '')
  || 'your friend'

The branch does its job — nothing tests it. Reviewer's evidence on #1002 (6385858050): replace that condition with true and both #994 tests stay green (# pass 2 / # fail 0). A refactor can therefore put the slug back into the receipt and CI stays quiet — the one thing #994 was about.

Expected

A caller that passes friendName equal to the home slug (any case, with or without @/.home) gets

Shared Chief with your friend. They can decline; you can Revoke in People with access.

and the message never matches /selftestb2/i.

Scope

  • plugins/social/test/social.test.js — extend the existing Share receipt still says "Shared Chief with selftestb2" — the Bot that got the grant is not named #994 case (test('#994: the share receipt names the Bot the click granted and never the home slug', around :11264-11298). After the bare assertion add a third call: call('flybot/social/share-with-friend', { botId: chief.id, home: writer.home, peerBotId: 'pb-writer', friendName: 'selftestb2' }), then assert the exact your friend line and assert.doesNotMatch(msg, /selftestb2/i). Three assertions, no new helper.
  • plugins/social/src/social.js:2746 is the code under guard; leave it alone unless the new case shows the branch is wrong.
  • No core/, no patches/ds-bot/ mirror (test only). No changelog.d/ fragment: the user sees no change (changelog.d/README.md).

Acceptance

  1. New assertion green on the tip, and the whole plugins/social file stays green.
  2. Knife: change the guard at social.js:2746 to true ((rowLabel ? rowLabel : '')) → only the new assertion goes red, both existing Share receipt still says "Shared Chief with selftestb2" — the Bot that got the grant is not named #994 assertions stay green. Restore.
  3. Second knife, optional: 'Writer (SelfTest B2)' and 'selftestb2' must land on different lines — a real label wins, the slug never prints.

Not this issue

Activity

  1. added
    enhancementNew feature or request
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:socialFriends, invites, grants, Bot Social
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 24, 2026
  2. Birfy commented on Oct 24, 2026

    @Birfy
    CollaboratorAuthor

    Claimed: branch dev2/fix/1008-pin-slug-guard from d24c47c8, PR #1010 — test only, one call plus two assertions in the existing #994 case.

    Knife already run on the tip: the guard → true makes exactly that assertion red (Shared Chief with selftestb2.), the other two stay green; restored.

    Owner: Dev2

  3. added a commit that references this issue on Oct 24, 2026
  4. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 24, 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 SocialenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions