e1e84d7d71f4ca4cbb0ede2d8bfc9288be5d5394
The fire-and-forget prefetch had a fundamental race: React renders all NoteCards immediately when the feed query resolves, before the prefetch has a chance to populate the cache. Each card's useAuthor call finds an empty cache and opens its own relay subscription — 20+ concurrent REQ messages per relay, which hits subscription limits and most fail silently. The only reliable fix is to await the prefetch inside the queryFn before returning items. This ensures ['author', pubkey] is in cache for every pubkey on the page when React renders the cards. useAuthor finds fresh data and never opens a relay subscription. Authors and stats are fetched in parallel (Promise.all), so the extra latency is max(author_time, stats_time) not their sum. With eoseTimeout at 500ms this adds ~500ms per page — a worthwhile tradeoff for reliable author resolution vs the broken fire-and-forget approach. Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
Description
Languages
TypeScript
95.7%
Java
1.5%
JavaScript
0.9%
Swift
0.9%
CSS
0.5%
Other
0.4%