Skip to content

post-475 fixes#481

Merged
tlongwell-block merged 3 commits intomainfrom
fix/member-display-names
May 5, 2026
Merged

post-475 fixes#481
tlongwell-block merged 3 commits intomainfrom
fix/member-display-names

Conversation

@tlongwell-block
Copy link
Copy Markdown
Collaborator

The member sidebar and @mention autocomplete show truncated pubkeys instead of display names.

Root cause: get_channel_members returns members from kind:39002 p-tags which only contain pubkeys and roles — no profile data. The old REST endpoint did a DB join to include names.

Fix: After fetching kind:39002, batch-fetch kind:0 profile events for all member pubkeys and populate display_name from profile content. Same approach the message timeline already uses via getUsersBatch.

37 lines changed, 1 file.

@tlongwell-block tlongwell-block changed the title fix(desktop): populate display names in channel members post-475 fixes May 5, 2026
@tlongwell-block tlongwell-block enabled auto-merge (squash) May 5, 2026 17:21
@tlongwell-block tlongwell-block disabled auto-merge May 5, 2026 17:22
@tlongwell-block tlongwell-block force-pushed the fix/member-display-names branch from d835d42 to 99eb675 Compare May 5, 2026 17:58
…arch

Two fixes for display names not showing in the pure-nostr desktop:

1. get_channel_members: batch-fetch kind:0 profiles for member pubkeys
   and populate display_name. Fixes member sidebar and @mention autocomplete.

2. search_users: replace NIP-50 Typesense search with fetch-all-kind:0 +
   client-side filter. The old REST endpoint used DB ILIKE; Typesense
   doesn't tokenize JSON content well for short name queries. Fetching
   ~2000 kind:0 events and filtering by display_name/nip05/pubkey prefix
   is equivalent performance for corporate-scale relays.
@tlongwell-block tlongwell-block force-pushed the fix/member-display-names branch from 99eb675 to c05db4d Compare May 5, 2026 18:01
tlongwell-block and others added 2 commits May 5, 2026 14:23
…e addressable events

In dev mode (SPROUT_REQUIRE_AUTH_TOKEN=false), the relay previously generated
a random keypair on every restart. Since replace_addressable_event keys on
(kind, pubkey, channel_id), each restart created duplicate kind:39000/39001/39002
events instead of replacing them — causing forum channels to appear as streams
and duplicate entries in the channel list.

Fix: use a hardcoded dev keypair (privkey=1, the secp256k1 generator point)
when no SPROUT_RELAY_PRIVATE_KEY is configured and auth is disabled. This
ensures addressable events replace correctly across restarts.

In production (require_auth_token=true), the relay now panics if no private
key is configured, preventing silent fallback to an unstable identity.
- resolve DM participant display names client-side via batch kind:0 fetch
- dedupe kind:39000 metadata by `d` tag, keeping the latest revision
- match desktop's case-insensitive sort within each channel section
- defer the "Could not load channels" view 2s to absorb transient
  AsyncError frames from relay reconnect cancellations

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tlongwell-block tlongwell-block merged commit ea62664 into main May 5, 2026
14 checks passed
@tlongwell-block tlongwell-block deleted the fix/member-display-names branch May 5, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants