The feed list asks the database three times per feed in a Patreon or OPML group for the group's title #159

Closed
opened 2026-10-08 18:36:25 -07:00 by rays · 1 comment
Owner

Found in a code audit on 2026-10-09.

subscriptions() (src/main.rs:1265-1268) builds the scan's and the page's list of feeds. For every feed derived from an OPML or a Patreon creator whose parent has no folder, it calls feed_summary on the parent, three queries, to read the parent's title: the same title for every child. Production has 32 such children (the-glass-cannon-network), so about 96 queries each time it runs: every /api/feeds (280 ms in production), every live update the page receives for a feed (once per open page), every scan and every wait between scans, the Directory, adding a feed.

Fix: look each parent's title up once per call.

Found in a code audit on 2026-10-09. `subscriptions()` (`src/main.rs:1265-1268`) builds the scan's and the page's list of feeds. For every feed derived from an OPML or a Patreon creator whose parent has no folder, it calls `feed_summary` on the parent, three queries, to read the parent's title: the same title for every child. Production has 32 such children (the-glass-cannon-network), so about 96 queries each time it runs: every `/api/feeds` (280 ms in production), every live update the page receives for a feed (once per open page), every scan and every wait between scans, the Directory, adding a feed. Fix: look each parent's title up once per call.
rays added the bug label 2026-10-08 18:36:25 -07:00
Author
Owner

Fixed in dc340dd: subscriptions() looks each group's title up once per call. /api/feeds measured 0.30 s after, against 0.28 s before: these queries were not where its time goes. Deployed as 0.10.3-dev on 2026-10-09.

Fixed in dc340dd: subscriptions() looks each group's title up once per call. /api/feeds measured 0.30 s after, against 0.28 s before: these queries were not where its time goes. Deployed as 0.10.3-dev on 2026-10-09.
rays closed this issue 2026-10-08 18:58:46 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#159