Repository navigation
fix(zaplytics): member avatars never loaded — queryKey collision with useAuthor - #170
Merged
ButtercupRobrts merged 3 commits intoNov 10, 2026
Conversation
…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.
Architecture Data flow No data-flow sequence changed in this PR. Review ✨ Nothing flagged · reviewed Tip Run 🪧 More tips
Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it. |
… + 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.
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.
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.