Skip to content

fix(desktop): fetch profiles for reaction actors and thread-reply authors#1550

Merged
wesbillman merged 1 commit into
mainfrom
max/reaction-profile-fetch
Jul 7, 2026
Merged

fix(desktop): fetch profiles for reaction actors and thread-reply authors#1550
wesbillman merged 1 commit into
mainfrom
max/reaction-profile-fetch

Conversation

@tlongwell-block

Copy link
Copy Markdown
Collaborator

Problem

Reaction pill popovers sometimes show a truncated pubkey instead of the reactor's display name (80c5f18b… reacted with :party_blob:) — reported by Wes in #buzz-bugs.

Root cause: reaction (kind-7) actors were never included in the profile fetch set. ChannelScreen builds messageProfilePubkeys from collectMessageAuthorPubkeys() (+ mentions/DM participants/agents/typing), and that collector filters on isTimelineContentEvent() — kind-7 excluded. formatTimelineMessages then renders each reactor via profiles?.[actorPubkey] with a ${pubkey.slice(0,8)}… fallback.

The exclusion is old, but the pre-#1500 client-assembled cache accumulated deep channel history, so nearly every reactor had also authored some message in the soup and got a name by side effect. Post-#1500 the timeline is one server-assembled window page; a reactor with no authored row inside the current page falls through to the fallback. (#1514's delta profile fetch is unrelated — it changes how the set is fetched, not what's in it.)

The thread panel had the same gap one level deeper: useIndependentThreadPanel fetched thread replies via its own useThreadReplies cache, so deep-thread reply authors and their reactors never reached the profile batch either.

Fix

  • New collectReactionActorPubkeys(events) (kind-7 only, actor-tag aware, skips deleted reactions, lowercase/dedup) — deliberately separate from collectMessageAuthorPubkeys, whose timeline-content semantics other callers rely on.
  • ChannelScreen merges reaction actors into the users-batch profile set, over [...resolvedMessages, ...threadReplyEvents].
  • useThreadReplies hoisted into ChannelScreen; threadReplyEvents feeds both the profile pubkey collection and useIndependentThreadPanel — thread reply authors/reactors now resolve from the same profile batch.
  • Marginal cost: perf: GIN index for e-tag containment + delta profile fetch (scroll-back ~2.1s/page) #1514's per-pubkey delta cache means new reactors cost one small kind-0 batch, never a re-download of resolved profiles.

Note: a few explanatory comments in ChannelScreen.tsx were trimmed to keep the file under the 1000-line CI gate (at 997 before this change); behavior they described is unchanged.

Validation

  • Live staging repro (root-cause confirmation + fix verification): Playwright spec driving the built bundle against the staging relay (sprout-oss.stage.blox.sqprod.co via in-cluster port-forward), targeting Wes's exact message/reaction.
    • main @ 4343c6d (RED): popover "80c5f18b… reacted with :party_blob:"; 8 kind-0 batches / 72 pubkeys requested — reactor's pubkey in none of them.
    • this branch @ 0bd12df (GREEN): popover "tho reacted with :party_blob:"; reactor's kind-0 requested and resolved.
  • Unit: collectReactionActorPubkeys coverage in formatTimelineMessages.test.mjs; full desktop unit suite 1630 pass / 0 fail.
  • E2E: new bridge-mock reaction-names.spec.ts (smoke project) — reactor with no authored message in the window resolves by name.
  • pnpm check + pnpm build green; ChannelScreen still under the size gate at 997 lines.

Diagnosis thread: #buzz-bugs 40260a3e. Implementation by Max; root-cause + staging verification by Eva.

Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
@wesbillman wesbillman merged commit 62def14 into main Jul 7, 2026
25 checks passed
@wesbillman wesbillman deleted the max/reaction-profile-fetch branch July 7, 2026 15:19
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.

3 participants