Current state
app/rss.xml/route.ts fetches Notion block children for each post inside a for...of loop, serialising N Notion API calls one after another. For a site with many posts, RSS generation time scales linearly with post count and with Notion API latency.
Ideal state
- Block children for all posts are fetched concurrently via
Promise.all (or Promise.allSettled).
- Total RSS generation time is bounded by the slowest single Notion response, not the sum of all responses.
- Individual fetch failures are surfaced per-post rather than aborting the entire feed.
Out of scope
Starting points
app/rss.xml/route.ts — the for...of loop around getBlockChildren (lines 25–46)
io/notion/getBlockChildren.ts — the underlying fetch to parallelise
QA plan
- Open
app/rss.xml/route.ts. Expect to see a for...of loop calling getBlockChildren sequentially for each post.
- After the fix, read the implementation. Expect a single
Promise.all (or Promise.allSettled) call wrapping all getBlockChildren invocations.
- Run
npm run build (or next build). Expect the RSS route to build without errors.
- Visit
/rss.xml in the built output. Expect a valid RSS feed containing entries for all published posts.
Done when
getBlockChildren is called for all posts in parallel during RSS generation, with no sequential await inside a loop over post items.
Current state
app/rss.xml/route.tsfetches Notion block children for each post inside afor...ofloop, serialising N Notion API calls one after another. For a site with many posts, RSS generation time scales linearly with post count and with Notion API latency.Ideal state
Promise.all(orPromise.allSettled).Out of scope
Starting points
app/rss.xml/route.ts— thefor...ofloop aroundgetBlockChildren(lines 25–46)io/notion/getBlockChildren.ts— the underlying fetch to paralleliseQA plan
app/rss.xml/route.ts. Expect to see afor...ofloop callinggetBlockChildrensequentially for each post.Promise.all(orPromise.allSettled) call wrapping allgetBlockChildreninvocations.npm run build(ornext build). Expect the RSS route to build without errors./rss.xmlin the built output. Expect a valid RSS feed containing entries for all published posts.Done when
getBlockChildrenis called for all posts in parallel during RSS generation, with no sequentialawaitinside a loop over post items.