Skip to content

Add configurable default feed fetch interval and related tests#130

Merged
lcomplete merged 3 commits intomainfrom
dev
Mar 31, 2026
Merged

Add configurable default feed fetch interval and related tests#130
lcomplete merged 3 commits intomainfrom
dev

Conversation

@lcomplete
Copy link
Copy Markdown
Owner

This pull request introduces a new global setting for the default feed fetch interval, allowing administrators and users to configure how often feeds are updated system-wide and per-feed. It updates both the backend and frontend to support this feature, including API models, database entities, settings UI, and validation/localization. The changes also improve the user experience by providing contextual hints and validation for fetch intervals.

Backend: Global and Feed Fetch Interval Support

  • Added defaultFeedFetchIntervalMinutes to the GlobalSetting entity, API model, and service, including database persistence and default value logic. [1] [2] [3] [4] [5] [6]
  • Updated FeedsSetting and related services to support an optional per-feed fetch interval, and to expose the system default to the frontend. [1] [2] [3] [4] [5]

Frontend: Settings UI and Validation

  • Added a global setting UI for the default feed fetch interval in the settings modal, with validation, persistence, and feedback messages. [1] [2] [3] [4] [5]
  • Improved the feed form to allow leaving the fetch interval blank (to use the default), with contextual helper text and placeholder, and updated validation logic accordingly. [1] [2] [3] [4]

Localization

  • Added English and Chinese translations for new settings labels, hints, and validation messages. [1] [2]

UI Enhancements

  • Added a schedule icon for the new global settings section in the UI.

These changes collectively make feed fetching intervals more flexible and user-friendly, while ensuring sensible defaults and clear communication throughout the UI.

- Add defaultFeedFetchIntervalMinutes field to GlobalSetting entity
- Expose setting via GlobalSettingService with fallback to HuntlyProperties
- Update ConnectorFetchService to use DB-stored default interval
- Update FeedsService to propagate per-feed and default interval separately
- Add defaultFetchIntervalMinutes to FeedsSetting interface model
- Add Global Settings section to FeedsTabContent with auto-save on blur
- Allow per-feed fetch interval to be left blank to inherit system default
- Add i18n keys for new UI strings in en and zh-CN locales
…-fetch-interval

feat(feeds): add configurable default feed fetch interval setting
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 29, 2026

🤖 Augment PR Summary

Summary: This PR makes RSS feed refresh cadence configurable by introducing a system-wide default fetch interval and allowing per-feed overrides to be optional.

Changes:

  • Added defaultFeedFetchIntervalMinutes to the backend GlobalSetting entity/service and exposed it via the API.
  • Updated connector fetching logic to use the global setting-derived default interval when a feed has no override.
  • Updated feed settings API/model to return both the per-feed interval (nullable) and the system default for UI display.
  • Enhanced the feed edit dialog to allow a blank interval (meaning “use system default”), with contextual helper text and a minutes adornment.
  • Added a “Global Settings” section in the Feeds settings UI to edit the default update interval, including validation and autosave-on-blur.
  • Added EN and zh-CN translations for new labels, hints, and save/failure messages.
  • Added JUnit tests covering default interval fallback behavior and clearing a per-feed override.

Technical Notes: Backend defaults fall back to huntly.defaultFeedFetchIntervalSeconds (converted to minutes, min 1) when no persisted value exists.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

folderId: yup.number().nullable(),
subscribeUrl: yup.string().required(t('settings:rssLinkRequired')),
fetchIntervalMinutes: yup.number().min(1, t('settings:fetchIntervalMin')).required(t('settings:fetchIntervalRequired'))
fetchIntervalMinutes: yup.number()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app/client/src/components/SettingModal/FeedsFormDialog.tsx:62: fetchIntervalMinutes validation currently allows non-integer values (e.g., 1.5), which may be truncated or rejected when deserializing into a Java Integer on the backend. Consider ensuring minutes are validated as whole numbers consistently for both per-feed and global default intervals.

Other locations where this applies: app/client/src/components/SettingModal/FeedsSetting.tsx:121

Severity: medium

Other Locations
  • app/client/src/components/SettingModal/FeedsSetting.tsx:121

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

connector.setSubscribeUrl(feedsSetting.getSubscribeUrl());
connector.setFolderId(feedsSetting.getFolderId() == null || feedsSetting.getFolderId().equals(0) ? null : feedsSetting.getFolderId());
connector.setFetchIntervalSeconds(feedsSetting.getFetchIntervalMinutes() * 60);
connector.setFetchIntervalSeconds(feedsSetting.getFetchIntervalMinutes() == null ? null : feedsSetting.getFetchIntervalMinutes() * 60);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app/server/huntly-server/src/main/java/com/huntly/server/service/FeedsService.java:116: fetchIntervalMinutes is converted to seconds without guarding against <= 0 (or very large) values, which could cause tight fetch loops or integer overflow in fetchIntervalSeconds. Even if the UI validates, API clients can still submit invalid values, so server-side validation would help protect background fetch scheduling.

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@lcomplete lcomplete merged commit 910d94a into main Mar 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant