Skip to content

perf(search): name searched people from the profile search response - #2353

Merged
kalvinnchau merged 1 commit into
mainfrom
peon/search-verified-heads
Nov 4, 2026
Merged

kalvinnchau merged 1 commit into
mainfrom
peon/search-verified-heads

Conversation

@kalvinnchau

@kalvinnchau kalvinnchau commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #2322 for block/buzz#9019. That relay change makes POST /profiles/search match verified names and return each found person's current relay-signed kind 30382 head next to their kind 0. It advertises this as federated_identity.public_profile.searchable: true in NIP-11.

Today the client drops those heads (kind === 0 filter), and useVerifiedNames reads them again. A person found only by verified name (fname → profile name Fak) stays hidden by rankPeople until that second read lands.

Behavior

  • The verified authority carries searchable from NIP-11. An equal refresh only keeps the current authority object if searchable is unchanged too.
  • Where the authority is searchable, createProfileSearch keeps each endpoint response's answers. Each person on the page gets their newest head by the relay key, or "none" when the response carried no head for them.
    • Answers are bounded (PROFILE_CACHE_BASE), taken once, tied to the authority that was current when they landed, and stand for 30 s.
    • The search's return value is unchanged: kind 0 only.
  • directMessages.verified answers those subjects from the kept answers through the same verifiedProfileSubject / verifiedProfile checks, and reads only the rest. A page the search fully answered sends no 30382 read.
  • useVerifiedNames and the UI are unchanged. Rows name themselves on the next render after a page settles, with no network wait.
  • Relays without the flag, the NIP-50 fallback, and authorities that change in flight keep the existing read.

Not in scope: people who are verified but have no kind 0 (still dropped, as before), and seeding the shared verified cache from search.

Validation

  • profile-search.test.ts:
    • keeps the newest relay head and ignores a forged-key head;
    • answers "none" for a person without a head;
    • an answer is taken once;
    • nothing is kept without searchable;
    • another authority object, or an answer older than 30 s, is not used.
  • direct-messages.test.ts: a real session searches with searchable, then verified() names the page with zero reads; without the flag it reads once. Replacing the kept answers with an empty map fails the searchable case.
  • verified-profile.test.ts: discovery parses searchable.
  • Run: tsc --noEmit; biome lint on src/features/relay; vitest on the touched relay tests plus src/features/profiles, SearchResults, ChannelMembersDialog and src/bundled/mentions (588 tests).

where nip-11 public_profile.searchable is set, /profiles/search returns each
found person's relay-signed kind 30382 head with their kind 0 (block/buzz#9019).
keep those answers, bounded, one-shot and for 30s, and let
directMessages.verified answer those subjects through the same
verifiedProfileSubject/verifiedProfile checks without a second read. a
person the response carried no head for is answered as unverified. relays
without the flag keep the existing read.

Co-authored-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Kalvin Chau <[email protected]>
@kalvinnchau
kalvinnchau marked this pull request as ready for review November 4, 2026 22:58
@kalvinnchau
kalvinnchau requested a review from a team as a code owner November 4, 2026 22:58

@wpfleger96 wpfleger96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 looks good. I checked the client against the relay side from block/buzz#9019: the endpoint returns each found person's current relay-signed head in the same page as their kind 0, and the heads table is written in the same transaction as the event, so reading a missing head as "none" matches what the separate 30382 read would have returned. one nonblocking test note inline

authority?.pubkey !== next.pubkey ||
authority.multipleIssuers !== next.multipleIssuers
authority.multipleIssuers !== next.multipleIssuers ||
authority.searchable !== next.searchable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 nonblocking: nothing covers this line. I removed it locally and every test under src/features/relay still passed. it matters most when a refresh flips searchable from true to false: the kept authority object would still say searchable, so keep() would record "none" for everyone on a page the relay no longer returns heads for, and those rows would show their profile names until useVerifiedNames re-asks 5 minutes later. a small case next to the discovery refresh tests in verified-profile.test.ts (refresh with searchable toggled, expect a new authority object) would pin it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Done as a follow-up in #2522: the test refreshes searchable, then searchable again (same object kept), then without the flag (new object). It fails with this line removed.

@kalvinnchau
kalvinnchau merged commit 8aa084c into main Nov 4, 2026
41 checks passed
@kalvinnchau
kalvinnchau deleted the peon/search-verified-heads branch November 4, 2026 23:09
wpfleger96 added a commit that referenced this pull request Nov 4, 2026
…-nip-fi

* origin/main:
  perf(search): name searched people from the profile search response (#2353)
  Use the merge queue for pull requests that require it (#2452)
  fix(browser): load scheme-less address input over https, falling back to http (#2467)
wpfleger96 added a commit that referenced this pull request Nov 4, 2026
…r-load-perf

* origin/main: (31 commits)
  test: fix invitation and coordination checks on main (#2517)
  perf(search): name searched people from the profile search response (#2353)
  Use the merge queue for pull requests that require it (#2452)
  fix(browser): load scheme-less address input over https, falling back to http (#2467)
  fix(identity): stop one-click key unlinks and show the linked backed-up key (#2486)
  fix(test): observe coordination transition events (#2297)
  fix(profiles): keep the next view's profile reads through a shrink (#2395)
  fix(channels): show Add and Send message errors above the Manage members list (#2421)
  fix(threads): keep reply hooks off agent activity bubbles (#2422)
  fix(channels): offer only Copy link in a not-joined preview's sidebar actions (#2425)
  test: scope row menu placement checks to active section rows (#2493)
  feat(relay): detach channel windows to a point in history (#2042)
  feat(identity): decide a missing backup choice from community membership (#2378)
  Offer Builderlab decisions in FI builds (#2227)
  feat(inbox): preview recent Inbox activity when hovering the sidebar row (#2347)
  Add collapsible Solo and Team sidebar sections (#2296)
  fix(codex): open long Codex transcripts a page of items at a time (#2259)
  Keep Solo model and effort choices per chat (#2342)
  feat(sidebar): smooth channel reordering with bounded motion (#2108)
  Connect legacy agents from DMs and channel mentions (#2423)
  ...
michaelneale added a commit that referenced this pull request Nov 4, 2026
* origin/main: (31 commits)
  test: fix invitation and coordination checks on main (#2517)
  perf(search): name searched people from the profile search response (#2353)
  Use the merge queue for pull requests that require it (#2452)
  fix(browser): load scheme-less address input over https, falling back to http (#2467)
  fix(identity): stop one-click key unlinks and show the linked backed-up key (#2486)
  fix(test): observe coordination transition events (#2297)
  fix(profiles): keep the next view's profile reads through a shrink (#2395)
  fix(channels): show Add and Send message errors above the Manage members list (#2421)
  fix(threads): keep reply hooks off agent activity bubbles (#2422)
  fix(channels): offer only Copy link in a not-joined preview's sidebar actions (#2425)
  test: scope row menu placement checks to active section rows (#2493)
  feat(relay): detach channel windows to a point in history (#2042)
  feat(identity): decide a missing backup choice from community membership (#2378)
  Offer Builderlab decisions in FI builds (#2227)
  feat(inbox): preview recent Inbox activity when hovering the sidebar row (#2347)
  Add collapsible Solo and Team sidebar sections (#2296)
  fix(codex): open long Codex transcripts a page of items at a time (#2259)
  Keep Solo model and effort choices per chat (#2342)
  feat(sidebar): smooth channel reordering with bounded motion (#2108)
  Connect legacy agents from DMs and channel mentions (#2423)
  ...

Signed-off-by: Michael Neale <[email protected]>
damienrj added a commit to damienrj/buzz-app that referenced this pull request Nov 4, 2026
…-clone-auth-ab8b97

* origin/main:
  feat(workflows): suggest channel members for @ in Send Message text (block#2309)
  AIDA-2344: Exclude muted channels from Dock (block#2313)
  feat(search): add slack-style message search operators on desktop (block#2463)
  test: fix invitation and coordination checks on main (block#2517)
  perf(search): name searched people from the profile search response (block#2353)
  Use the merge queue for pull requests that require it (block#2452)

Signed-off-by: damienrj <[email protected]>
johnmatthewtennant added a commit that referenced this pull request Nov 5, 2026
* origin/main:
  fix(messages): keep the hover toolbar while its menu is open (#2439)
  feat(workflows): suggest channel members for @ in Send Message text (#2309)
  AIDA-2344: Exclude muted channels from Dock (#2313)
  feat(search): add slack-style message search operators on desktop (#2463)
  test: fix invitation and coordination checks on main (#2517)
  perf(search): name searched people from the profile search response (#2353)
  Use the merge queue for pull requests that require it (#2452)
cheng-block added a commit to cheng-block/buzz-app that referenced this pull request Nov 5, 2026
…punctuation

* upstream/main: (78 commits)
  fix(plugins): read Square HTTPS sources with the Block SSH agent (block#2465)
  feat(plugins): let agents request plugin changes for owner review (block#2280)
  fix(messages): keep the hover toolbar while its menu is open (block#2439)
  feat(workflows): suggest channel members for @ in Send Message text (block#2309)
  AIDA-2344: Exclude muted channels from Dock (block#2313)
  feat(search): add slack-style message search operators on desktop (block#2463)
  test: fix invitation and coordination checks on main (block#2517)
  perf(search): name searched people from the profile search response (block#2353)
  Use the merge queue for pull requests that require it (block#2452)
  fix(browser): load scheme-less address input over https, falling back to http (block#2467)
  fix(identity): stop one-click key unlinks and show the linked backed-up key (block#2486)
  fix(test): observe coordination transition events (block#2297)
  fix(profiles): keep the next view's profile reads through a shrink (block#2395)
  fix(channels): show Add and Send message errors above the Manage members list (block#2421)
  fix(threads): keep reply hooks off agent activity bubbles (block#2422)
  fix(channels): offer only Copy link in a not-joined preview's sidebar actions (block#2425)
  test: scope row menu placement checks to active section rows (block#2493)
  feat(relay): detach channel windows to a point in history (block#2042)
  feat(identity): decide a missing backup choice from community membership (block#2378)
  Offer Builderlab decisions in FI builds (block#2227)
  ...

Signed-off-by: Cheng Peng <[email protected]>

# Conflicts:
#	docs/buzz-help.md
gilgtm added a commit that referenced this pull request Nov 5, 2026
…lled-read

* origin/main: (28 commits)
  Run native Codex through plugin execution targets (#2150)
  test: split Solo access browser scenarios (#2499)
  feat(agents): let any agent change Buzz settings through the MCP (#2248)
  Let plugins decorate host sidebar rows and add sort modes (#1853)
  NEXUS-4082: Keep the new-message boundary stable during a visit (#2083)
  feat(agents): move version history into settings (#2374)
  fix(agents): read goose Activity by saved session ids and render memory bodies on open (#2466)
  feat(channels): starter channels: admin switch and relay auto_join flag (#1624)
  fix(plugins): read Square HTTPS sources with the Block SSH agent (#2465)
  feat(plugins): let agents request plugin changes for owner review (#2280)
  fix(messages): keep the hover toolbar while its menu is open (#2439)
  feat(workflows): suggest channel members for @ in Send Message text (#2309)
  AIDA-2344: Exclude muted channels from Dock (#2313)
  feat(search): add slack-style message search operators on desktop (#2463)
  test: fix invitation and coordination checks on main (#2517)
  perf(search): name searched people from the profile search response (#2353)
  Use the merge queue for pull requests that require it (#2452)
  fix(browser): load scheme-less address input over https, falling back to http (#2467)
  fix(identity): stop one-click key unlinks and show the linked backed-up key (#2486)
  fix(test): observe coordination transition events (#2297)
  ...

Signed-off-by: Gil Birman <[email protected]>
Co-authored-by: Claude <[email protected]>

# Conflicts:
#	docs/buzz-help.md
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