Made RSS renderer synchronous#27841
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThis PR converts the RSS feed generation pipeline from asynchronous Promise-based execution to synchronous operation. It updates JSDoc to document string return types for cache and generateFeed, replaces the Promise reduce chain in feed generation with a synchronous for...of that returns feed.xml(), updates the renderer to call rssCache.getXML synchronously and send the result immediately, and adjusts unit tests to expect synchronous behavior. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
no ref *I recommend reviewing this with whitespace changes disabled.* It was already synchronous, but we made it async for no reason I could see. This change should have no user impact.
d22d269 to
388940a
Compare
| return data.posts.reduce((feedPromise, post) => { | ||
| return feedPromise.then(() => { | ||
| const item = generateItem(post); | ||
| return feed.item(item); | ||
| }); | ||
| }, Promise.resolve()).then(() => { | ||
| return feed.xml(); | ||
| }); | ||
| for (const post of data.posts) { | ||
| const item = generateItem(post); | ||
| feed.item(item); | ||
| } | ||
|
|
||
| return feed.xml(); |
There was a problem hiding this comment.
praise: love this, so much nicer to read this way
no ref
I recommend reviewing this with whitespace changes disabled.
It was already synchronous, but we made it async for no reason I could see. This change should have no user impact.