shakespeare.diy 25b2e274be Prevent individual queries from racing with batch queries
useAuthor and useEventStats were firing individual queries simultaneously
with the batch hooks (useAuthors, useBatchEventStats), causing a flood of
concurrent relay subscriptions. Each NoteCard's useAuthor created its own
kind:0 query even though useAuthors in Feed.tsx was about to fetch the
same data in a single batched query.

Fix: Use useIsFetching to detect when a batch query is in-flight and
disable individual queries until the batch completes. The batch seeds
individual cache entries, so useAuthor/useEventStats resolve instantly
from cache without ever firing their own relay queries.

On pages without batch queries (PostDetailPage, NotificationsPage, etc.),
batchFetching === 0 immediately, so individual hooks fire normally.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-18 01:53:12 -06:00
2026-02-16 16:54:01 -06:00
2026-02-16 16:54:01 -06:00
S
Description
Activist social network and fundraising platform on Nostr
AGPL-3.0 43 MiB
Languages
TypeScript 95.7%
Java 1.5%
JavaScript 0.9%
Swift 0.9%
CSS 0.5%
Other 0.4%