Skip to content

fix(desktop): show cached display names on startup - #3317

Open
TheSentinel454 wants to merge 1 commit into
block:mainfrom
TheSentinel454:tornquist/display-name-cache
Open

fix(desktop): show cached display names on startup#3317
TheSentinel454 wants to merge 1 commit into
block:mainfrom
TheSentinel454:tornquist/display-name-cache

Conversation

@TheSentinel454

Copy link
Copy Markdown
Contributor

Why

Buzz restores cached channels and messages before profile lookups complete. On launch, that briefly exposes pubkey-derived labels in place of familiar display names.

What

  • Persist a bounded, relay-scoped cache of last-known display names, NIP-01 names, and NIP-05 handles
  • Seed batch profile queries from those labels immediately, while keeping them stale so the existing relay request revalidates them
  • Keep cached data presentation-only: avatars and ownership metadata are not persisted or used to seed profile-detail caches
  • Remove cleared or missing profiles, purge a relay's labels when its community is removed, and include the cache in local-storage quota recovery
  • Add unit coverage for parsing, bounds, eviction, malformed data, and cleared profiles
  • Add an E2E regression that delays the relay profile response and verifies the cached name is rendered first

Risk Assessment

Low. The cache is disposable, capped at 1,000 entries per relay, scoped by normalized relay URL, and always revalidated. It contains only public label fields and does not restore avatars, agent ownership, or authorization state.

Verification

  • just ci
  • pnpm typecheck
  • pnpm test — 3,727 passed
  • pnpm exec playwright test tests/e2e/channels.spec.ts --grep "cached profile labels" — passed

Generated with Codex

@TheSentinel454

Copy link
Copy Markdown
Contributor Author

🤖 Before / after with the relay profile response deliberately delayed:

Before After
Before: pubkey-derived label After: cached display name

@TheSentinel454
TheSentinel454 marked this pull request as ready for review July 28, 2026 15:01
@TheSentinel454
TheSentinel454 requested a review from a team as a code owner July 28, 2026 15:01
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.

1 participant