Skip to content

fix(zaplytics): member avatars never loaded — queryKey collision with useAuthor - #170

Merged
ButtercupRobrts merged 3 commits into
HiveTalk:mainfrom
ButtercupRobrts:fix/member-profile-cache-key
Nov 10, 2026
Merged

ButtercupRobrts merged 3 commits into
HiveTalk:mainfrom
ButtercupRobrts:fix/member-profile-cache-key

Conversation

@ButtercupRobrts

Copy link
Copy Markdown
Collaborator

useMemberProfiles (ContributorNetworkGraph) and useAuthor both cache under ['author', pubkey] but return different shapes — {name, picture} vs {event, metadata}. Whichever query resolved first owned the slot; when useAuthor won, member nodes read 'picture' off the wrong shape → undefined → plain circles permanently. Distinct 'member-profile' key fixes it; verified against prod data.

…des with useAuthor

useMemberProfiles and useAuthor both cache under ['author', pubkey] but
return different shapes ({name,picture} vs {event,metadata}). Whichever
resolved first owned the slot; when useAuthor won, member nodes read
'picture' off the wrong shape and always rendered plain circles.
@coldtea-pr-lens

coldtea-pr-lens Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
  • Redraw · drawn at fe17260, the branch has moved on

Architecture

Architecture diagram for HiveTalk/nostr-cms at fe17260

Open the canvas


Data flow

No data-flow sequence changed in this PR.


Review

✨ Nothing flagged · reviewed fe17260


Tip

Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture… row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion
  • Set github.description: false in .github/pr-lens.yml to stop PR Lens adding buttons to your PR descriptions

Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.  Star PR Lens on GitHub

… + discovery relays

- EditProfileForm now invalidates ['member-profile', pubkey] alongside
  'author' — edited avatars stayed stale for up to 5min in the graph
- useMemberProfiles reads the cached useAuthor result first (avoids
  duplicate fetches vs the member table) and fans out to the same
  fallback discovery relays useAuthor uses
invalidateQueries marks data stale but getQueryData still returns the
pre-invalidation copy — the graph could reuse an old avatar before the
author query refetches. Check getQueryState().isInvalidated first.
@ButtercupRobrts
ButtercupRobrts merged commit 977d743 into HiveTalk:main Nov 10, 2026
6 checks passed
@ButtercupRobrts
ButtercupRobrts deleted the fix/member-profile-cache-key branch November 10, 2026 23:40
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