fix(desktop): surface eligible relay agents in @mention - #4517
Open
w3bsited3v wants to merge 1 commit into
Open
Conversation
The @mention composer (useMentions) dropped every agent that was not in the viewer's own local managed-agents store, via isAgentIdentityInManagedList. As a result, relay agents owned by another identity (e.g. a shared, relay-hosted agent run by a separate operator) never appeared in @mention autocomplete, even though the "+" New-DM picker showed them and DMs to them worked. Keep an agent candidate when it is either locally managed OR an eligible relay agent (already present in mentionableAgentPubkeys, i.e. it passed relayAgentIsSharedWithUser). This aligns desktop @mention with the mobile client, whose buildMentionCandidates has no managed-list gate and already surfaces any relay agent that is `anyone` and shares a channel with the viewer. Signed-off-by: w3bsited3v <dev@jdd.agency>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Desktop @mention autocomplete drops shared relay agents — agents owned by
another identity, e.g. a relay-hosted agent run by a separate operator and
shared with a team.
useMentionsfilters candidates throughisAgentIdentityInManagedList, which only keeps agents present in theviewer's own local
managed-agentsstore. So an eligible relay agent isnever offered in
@-autocomplete, even though the+New-DM picker lists itand DMs to it work.
The mobile client's
buildMentionCandidates(
mobile/lib/features/channels/mentions/mention_candidates.dart) has nosuch gate — it has no local agent store — and already surfaces any relay
agent that is
anyoneand shares a channel with the viewer. This changebrings desktop in line: keep an agent candidate when it is either locally
managed or already eligible via
mentionableAgentPubkeys(i.e. it passedrelayAgentIsSharedWithUser). Eligibility semantics are unchanged — the fixonly stops the managed-list filter from dropping already-eligible relay
agents.
Related issue
Fixes #4128. Related: #3971, #3125, #3776.
Testing
Verified against a self-hosted relay: a shared, relay-hosted agent
(
respond_to=anyone, joined to a channel the viewer is a member of, with akind:10100 directory entry) now appears in desktop
@-mention autocomplete,matching the mobile client. Previously it was reachable only via the
+New-DM picker.
pass
isAgentIdentityInManagedList).mentionableAgentPubkeysset, so no new eligibilitypath is introduced.
Happy to add a focused test if you'd like — the current
useMentions.test.mjsonly covers thehasMentionstring helpers, so thecandidate-assembly path isn't unit-tested today; let me know your preference
for structuring one.