🐛 Infinite Loading Loop on Skills Page (Related to #85) #37

Closed
opened 2026-02-15 17:15:16 -05:00 by yindo · 0 comments
Owner

Originally created by @xcqtnr on GitHub (Feb 1, 2026).

Runaway queries causing excessive server load on skills page

The Problem

Scrolling to the bottom of /skills and staying idle causes infinite query requests via WebSocket - the server keeps processing queries until you navigate away.

![Infinite loading loop demo](

https://github.com/user-attachments/assets/c1af58fe-f6bb-4fb0-8c38-68a4aa29436d

)

Why It Happens

┌──────────────────────────────────────────────────────────┐
│  User at bottom of page                                  │
│           ↓                                              │
│  IntersectionObserver fires → loadMore()                 │
│           ↓                                              │
│  New data arrives                                        │
│           ↓                                              │
│  Client-side sorting re-renders entire list              │
│           ↓                                              │
│  "Load more" div still visible → Observer fires again    │
│           ↓                                              │
│  🔄 LOOP REPEATS INFINITELY                              │
└──────────────────────────────────────────────────────────┘

Root Cause

Two issues in src/routes/skills/index.tsx:

  1. Lines 163-189: Sorting happens client-side after each page load → causes re-renders
  2. Lines 207-221: IntersectionObserver has no loading guard → keeps firing while visible

Impact

  • 🔴 Server load spikes (continuous requests)
  • 🔴 Increased Convex usage/costs
  • 🟠 Browser becomes sluggish

Fix

I'm working on a PR that:

  1. Moves sorting to backend using existing indexes (by_stats_downloads, etc.)
  2. Adds isLoadingMore guard to the observer
  3. This also fixes Publish fails with 'GitHub account lookup failed' error (#85)

Related: #85 (Sort feature shows wrong results) - same root cause

Originally created by @xcqtnr on GitHub (Feb 1, 2026). # Runaway queries causing excessive server load on skills page ## The Problem Scrolling to the bottom of `/skills` and staying idle causes **infinite query requests via WebSocket** - the server keeps processing queries until you navigate away. ![Infinite loading loop demo]( https://github.com/user-attachments/assets/c1af58fe-f6bb-4fb0-8c38-68a4aa29436d ) ## Why It Happens ``` ┌──────────────────────────────────────────────────────────┐ │ User at bottom of page │ │ ↓ │ │ IntersectionObserver fires → loadMore() │ │ ↓ │ │ New data arrives │ │ ↓ │ │ Client-side sorting re-renders entire list │ │ ↓ │ │ "Load more" div still visible → Observer fires again │ │ ↓ │ │ 🔄 LOOP REPEATS INFINITELY │ └──────────────────────────────────────────────────────────┘ ``` ## Root Cause Two issues in `src/routes/skills/index.tsx`: 1. **Lines 163-189**: Sorting happens client-side after each page load → causes re-renders 2. **Lines 207-221**: IntersectionObserver has no loading guard → keeps firing while visible ## Impact - 🔴 Server load spikes (continuous requests) - 🔴 Increased Convex usage/costs - 🟠 Browser becomes sluggish ## Fix I'm working on a PR that: 1. Moves sorting to backend using existing indexes (`by_stats_downloads`, etc.) 2. Adds `isLoadingMore` guard to the observer 3. This also fixes #85 --- **Related:** #85 (Sort feature shows wrong results) - same root cause
yindo closed this issue 2026-02-15 17:15:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#37