Remove unnecessary SSR prefetch for user subscriptions
Summary
Removes the wasteful SSR prefetch for getSubscriptions(observer) in server-side-layout.tsx.
Problem
The SSR prefetch was wasteful for both user types:
| User Type | What happened | Result |
|---|---|---|
| Non-logged-in | Fetched hive.blog's subscriptions (DEFAULT_OBSERVER) |
Never used - client query disabled |
| Logged-in | SSR prefetched, then client fetched again | Redundant call |
Why SSR prefetch isn't needed here
The subscriptions data is used for the "My Communities" sidebar (CommunitiesMyBar):
- Not SEO-critical - bots don't need personal subscriptions
- Not above-the-fold - it's sidebar content
- Personal data - only relevant when logged in
How client already handles this
main-page-layout.tsx has the correct logic:
const { data, isFetching } = useQuery({
queryKey: ['subscriptions', user.username],
queryFn: () => getSubscriptions(user.username),
enabled: user.isLoggedIn && !!user?.username // Only when logged in
});
// Shows Skeleton while fetching
// Shows CommunitiesMyBar if data exists
// Falls back to CommunitiesSidebar otherwise
Impact
- Saves 1 API call per feed page for all users
- Reduces unnecessary load on Hive API (relevant to 503 errors during high traffic)
- Simplifies SSR - less data to prefetch/hydrate
Test Plan
-
Visit
/trendingas non-logged-in user → sidebar shows generic communities list -
Visit
/trendingas logged-in user → sidebar loads "My Communities" (may show skeleton briefly) - No console errors or hydration mismatches
Fixes #790 (closed)