Repository navigation
fix: groups pages spinning when signed out, slow endorsement graph (TECH-806, TECH-808) - #259
Conversation
…ned out Signed out, OrgProvider returned before fetching without clearing isLoading, so every page waiting on the org list sat on its spinner forever instead of showing the sign-in prompt. useOrgCreationLimit had the same hang on its own since c749825: its render-time reset only fires when the did|orgsLoading key changes, so with the org list already settled at mount, isChecking stayed true. It now reports isChecking only while there is a signed-in DID to check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On production the graph took about 19s to appear: about 6s of indexer pages, then about 12s resolving ~240 DIDs in five 50-DID requests sent one after another, and only then the first draw. - useEndorsementGraph shows the graph as soon as its structure and the actor-profile index data are in, then fills handles and avatars into the same node objects (react-force-graph keeps layout positions on them, so the layout doesn't restart). - The resolve-dids batcher sends up to three chunks of a flush at once. The server charges its rate limit per identity, so the volume is unchanged. After a 429, remaining chunks degrade to null instead of being sent into the cooldown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| for (const node of nodes) Object.assign(node, identity(node.id)) | ||
| return { ...graph, nodes: [...nodes] } |
There was a problem hiding this comment.
Replacing the nodes array makes EndorsementGraph rebuild data. Its layout effect calls d3ReheatSimulation(), and onEngineStop then calls zoomToFit(). Users who zoom into the early graph while names load get zoomed back out when loading finishes. Keeping the same node objects preserves their positions, but does not prevent this restart.
Refresh labels separately from the graph structure so updates to names and avatars do not restart the layout or move the camera.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/hooks/use-endorsement-graph.ts
Line: 388-389
Comment:
**Names arriving reset the zoom**
Replacing the `nodes` array makes `EndorsementGraph` rebuild `data`. Its layout effect calls `d3ReheatSimulation()`, and `onEngineStop` then calls `zoomToFit()`. Users who zoom into the early graph while names load get zoomed back out when loading finishes. Keeping the same node objects preserves their positions, but does not prevent this restart.
Refresh labels separately from the graph structure so updates to names and avatars do not restart the layout or move the camera.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Hotfix to
mainfor two fixes already onstaging(0f7a240, 65b77bf), cherry-picked without the TECH-789 commits.TECH-806: /groups/create and /groups/import spin forever when signed out
OrgProvider.fetchOrgsreturned early when signed out without clearingisLoading, so it stayedtrue.useOrgCreationLimitonly clearedisCheckingwhen itsdid|orgsLoadingkey changed. If the org list had already settled at mount, nothing changed and the check stayed stuck.TECH-808: /endorsement-graph takes ~19s to appear
Testing
tsc,typecheck:test,lint,lint:css, 1346 unit tests,build.Not covered: whether /groups/create also hung when signed in (needs a signed-in session). TECH-807 (OAuth
requestLock) is a separate fix.🤖 Generated with Claude Code
The PR appears safe to merge, with a non-blocking graph update that resets the user's zoom when names arrive.
Fix with agent prompt
Summary
Fixes signed-out group pages and shows the endorsement graph before names and avatars finish loading.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Load graph structure] --> B[Show interactive graph] B --> C[Resolve names and avatars] C --> D[Update shared node objects] D --> E[Replace node array] E --> F[Restart layout] F --> G[Fit whole graph into view]Reviews (1) · Last reviewed commit: "perf(endorsement-graph): draw the graph ..." · Reviewed by Greptile