Repository navigation
Conversation
added 4 commits
November 2, 2026 22:35
Parse the first usable kind-0 name instead of letting a blank display_name mask a valid name, and treat malformed or non-object metadata as empty. Keep known and configured names when newer metadata has no name, hydrate channel and message authors before history becomes visible, and use one localized Member/Agent fallback across chat, inbox, repos, and agent activity surfaces. Signed-off-by: Gwhyyy <gw@v2202608398033499741.nicesrv.de>
Render cached messages before profile hydration, detach startup presence from the channel gate, bound HTTP queries, reject malformed relay events, and reuse agent metadata names. Signed-off-by: Gwhyyy <gw@v2202608398033499741.nicesrv.de>
Signed-off-by: Gwhyyy <gw@v2202608398033499741.nicesrv.de>
Signed-off-by: Gwhyyy <gw@v2202608398033499741.nicesrv.de>
There was a problem hiding this comment.
🟡 Changes recommended
The relay event guard still accepts missing or malformed tags and non-string content, allowing events with missing tags to crash chat rendering.
4 open issues
What changed in this PR
This PR improves the browser client's behavior on slow relays by making profile names more readable and removing profile and presence lookups from the channel-loading gate.
Changes:
- Centralizes localized fallback names and preserves known names when metadata has no usable name.
- Loads profiles and presence asynchronously, adds HTTP query timeouts, and closes subscriptions that resolve after cancellation.
- Adds relay-event validation, recognizes ordinary membership for known agents, and updates related tests.
| File | Description |
|---|---|
web/tests/e2e/p0.spec.ts |
Updates the expected member fallback label. |
web/src/shared/i18n/index.ts |
Adds English and Chinese member labels. |
web/src/shared/api/relay-client.ts |
Adds HTTP timeouts and event-field checks. |
web/src/shared/api/relay-client.test.ts |
Tests malformed events and stalled HTTP queries. |
web/src/features/repos/ui/ReposPanel.tsx |
Reuses the shared profile fallback. |
web/src/features/inbox/ui/InboxView.tsx |
Uses readable fallback names throughout Inbox. |
web/src/features/chat/ui/ThreadPanel.tsx |
Uses shared fallbacks for thread participants. |
web/src/features/chat/ui/MessageList.tsx |
Centralizes message-author fallback names. |
web/src/features/chat/ui/BuzzWebApp.tsx |
Uses the shared fallback for the settings profile. |
web/src/features/chat/ui/AppDialogs.tsx |
Uses readable author names in search results. |
web/src/features/chat/ui/AgentActivityPanel.tsx |
Adds agent-aware fallback names. |
web/src/features/chat/lib/use-buzz-session.ts |
Detaches lookups and handles late subscription cleanup. |
web/src/features/chat/lib/chat-model.ts |
Adds resilient name parsing, profile merging, and display helpers. |
web/src/features/chat/lib/chat-model.test.ts |
Tests metadata handling, name preservation, and localized fallbacks. |
web/src/features/agents/lib/relay-agents.ts |
Improves name parsing and known-agent channel associations. |
web/src/features/agents/lib/relay-agents.test.ts |
Tests membership handling and agent-name fallbacks. |
Review effort: Balanced
Comment on lines
+294
to
+297
| typeof event.id !== "string" || | ||
| typeof event.pubkey !== "string" || | ||
| typeof event.created_at !== "number" || | ||
| typeof event.kind !== "number" |
| ...config.agents.map((agent) => agent.pubkey), | ||
| ...nextDiscovered.flatMap((channel) => channel.members.map((member) => member.pubkey)), | ||
| ]; | ||
| void loadProfiles(profilePubkeys); |
| limit: profilePubkeys.length, | ||
| }, | ||
| ]) | ||
| .then((events) => applyPresenceEvents(events, profilePubkeys)) |
Comment on lines
+462
to
+464
| void loadProfiles( | ||
| event.kind === 40099 ? systemMessagePubkeys(event) : [event.pubkey], | ||
| ); |
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.


What this fixes
I hit three related issues while testing the web client against a slow relay:
display_namevalues masked a validname, and several surfaces fell back totruncatePubkeyinstead of a readable label.fetchwithout a timeout, and channel loading awaited it before rendering.This also fixes a malformed-relay-frame crash and lets an already-configured agent be associated with its channel when it has ordinary
membermembership rather than thebotrole.Changes
display_name,displayName,name), ignore blank/non-object metadata, and keep a previously known name when newer metadata has none.Member <short>/Agent <short>in English and Simplified Chinese; no raw hex is used as a display name./queryHTTP requests after the existing 25s operation timeout.EVENTframes before they reach consumers.No Relay, protocol, identity, theme-storage, branding, or deployment changes. The fallbacks are local labels, not invented public profiles.
Verification
npm test— 24 files, 109 tests pass.npm run typecheck,npm run check,npm run build— pass.Happy to split this into separate profile and relay-robustness PRs if you prefer a smaller review.