Skip to content

fix: fetch the feed only on the server - #43

Merged
scardanzan merged 1 commit into
masterfrom
fix/issue-41-fetch-feed-once
Nov 27, 2026
Merged

scardanzan merged 1 commit into
masterfrom
fix/issue-41-fetch-feed-once

Conversation

@paodb

@paodb paodb commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

The constructor enabled auto on the web component, so the browser requested the feed again through iron-ajax after the server had already fetched it and sent the items. The extra request fails when the feed does not allow cross-origin requests, and when it succeeds its response replaces the items rendered from the server response. The constructor no longer enables auto, so the feed is fetched only once, on the server.

Note: if the feed cannot be fetched from the server but can from the browser (for example, it is only reachable from the user's network or needs the user's cookies), the component now shows the error item instead of the items loaded by the browser. Calling setAuto(true) restores the previous behavior.

Close #41

Summary by CodeRabbit

  • Behavior Changes
    • Automatic mode is no longer enabled by default for RSS items. Maximum item count, excerpt length, and title length settings remain unchanged.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The RssItems constructor no longer sets auto to true. It continues to configure the maximum item count, excerpt length, and title length.

Changes

Feed fetching

Layer / File(s) Summary
Constructor auto setting
src/main/java/com/flowingcode/vaadin/addons/rssitems/RssItems.java
The constructor no longer sets the component’s auto property to true.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • FlowingCode/RssItemsAddon#37: Updates server-side feed decoding to use UTF-8 when no charset is declared; the linked issue notes that browser-side fetching can bypass this handling.

Suggested reviewers: scardanzan

Merge Risk: Minimal · up to ba895

This change stops the browser from fetching the feed again after the server has already fetched it. That avoids cross-origin failures and server-rendered items being overwritten. Feeds reachable only from the user's network or that need the user's cookies will now show the error item unless setAuto(true) is called. No further merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title 'fix: fetch the feed only on the server' matches the main change: the RssItems constructor no longer calls setAuto(true), so the browser stops re-fetching the feed after the server has fetch…
Linked Issues check Passed [#41] The requirement is that the feed is fetched only once, on the server. The reviewed head removes the setAuto(true) call from the RssItems constructor (raw summary: +0/-1 in RssItems.java). In…
Out of Scope Changes check Passed The change set is limited to one removed line in the RssItems constructor, per the supplied raw summary. The removal directly implements #41, which requires that the browser not request the feed aga…
Full details: Title check

Explanation

The title 'fix: fetch the feed only on the server' matches the main change: the RssItems constructor no longer calls setAuto(true), so the browser stops re-fetching the feed after the server has fetched it. The title is specific and describes the primary behavior change. It uses a conventional-commit prefix and is 8 words long.

Full details: Linked Issues check

Explanation

[#41] The requirement is that the feed is fetched only once, on the server. The reviewed head removes the setAuto(true) call from the RssItems constructor (raw summary: +0/-1 in RssItems.java). In rss-items.js at head, the auto property defaults to false, and the template binds <iron-ajax ... auto="[[auto]]"> to it. With the default, iron-ajax does not issue a browser request. The server-side fetch and xmlToItems path remain. The browser request therefore no longer occurs by default, which meets the issue expectation. Limits: the whole-PR diff could not be read, so the removal relies on the supplied summary and the head file. No automated test is required by the issue, and none was found in the supplied evidence. The auto attribute still appears in the component's doc example at the top of rss-items.js. This is documentation only and does not change runtime behavior.

Full details: Out of Scope Changes check

Explanation

The change set is limited to one removed line in the RssItems constructor, per the supplied raw summary. The removal directly implements #41, which requires that the browser not request the feed again. No unrelated code, refactoring, or documentation changes are reported. The PR description's note that setAuto(true) restores the previous behavior is a documented consequence of the same change, not extra scope. Limit: the whole-PR diff could not be read, so this conclusion relies on the supplied summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: add34d3d-4838-4041-8cda-9769b61f1993
Commits

Reviewing files that changed from the base of the PR and between a28eac1 and ba895bb.

Files selected for processing: 1

  • src/main/java/com/flowingcode/vaadin/addons/rssitems/RssItems.java
Files with no reviewable changes: 1

  • src/main/java/com/flowingcode/vaadin/addons/rssitems/RssItems.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@paodb
paodb marked this pull request as ready for review November 25, 2026 19:20
@paodb
paodb requested a review from scardanzan November 25, 2026 19:20
@scardanzan
scardanzan merged commit feae7b8 into master Nov 27, 2026
9 checks passed
@scardanzan
scardanzan deleted the fix/issue-41-fetch-feed-once branch November 27, 2026 18:21
@github-project-automation github-project-automation Bot moved this to Pending release in Flowing Code Addons Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

Feed is fetched twice, from the server and from the browser

2 participants