RSS Feed Checker Timer #534

Closed
opened 2025-11-24 22:08:17 +00:00 by Vylpes · 5 comments
Owner

Epic: #528
Story Points:


Implement a scheduled task to check all RSS feeds every 15 minutes

Acceptance Criteria

GIVEN I am a member
AND a channel I can view has a feed subscribed to
WHEN it reaches 15 minutes of the hour (n:00, n:15, n:30, n:45)
THEN each feed in that channel will be fetched and sent

GIVEN I am a member
WHEN a feed fails to be fetched
THEN an error is logged via the AppLogger
AND an error is sent to the channel in an embed

Subtasks

  • Create RssTimer.ts in src/timers/
  • Setup cron job to run every 15 minutes (*/15 * * * *)
  • Fetch all active RSS feeds from database
  • For each feed, fetch and parse new items
  • Compare with lastFetchedItemGuid to identify new entries
  • Post new entries to designated Discord channel
  • Update lastFetchedItemGuid in database after successful post
  • Add error handling and logging for failed feeds
  • Update tests

Notes

No notes

Epic: #528 Story Points: --- Implement a scheduled task to check all RSS feeds every 15 minutes ## Acceptance Criteria GIVEN I am a member AND a channel I can view has a feed subscribed to WHEN it reaches 15 minutes of the hour (n:00, n:15, n:30, n:45) THEN each feed in that channel will be fetched and sent GIVEN I am a member WHEN a feed fails to be fetched THEN an error is logged via the `AppLogger` AND an error is sent to the channel in an embed ## Subtasks - [x] Create `RssTimer.ts` in `src/timers/` - [x] Setup cron job to run every 15 minutes (`*/15 * * * *`) - [x] Fetch all active RSS feeds from database - [x] For each feed, fetch and parse new items - [x] Compare with `lastFetchedItemGuid` to identify new entries - [x] Post new entries to designated Discord channel - [x] Update `lastFetchedItemGuid` in database after successful post - [x] Add error handling and logging for failed feeds - [x] Update tests ## Notes *No notes*
Vylpes added this to the 3.4.0 milestone 2025-11-24 22:17:40 +00:00
Smithy-bot stopped working 2026-10-26 11:05:17 +00:00
48 seconds
Member

Implemented on cursor/534-rss-feed-checker-timer (from feature/epic-528-rss-feeds).

PR ready for review: #592

  • Cron */15 * * * * Europe/London via RssTimer
  • Posts new items oldest-first; updates LastFetchedItemGuid after each successful post
  • Fetch failures → AppLogger.error + danger embed in the feed channel
  • Local: yarn build / yarn test PASS (8 suites / 97 tests)

Moved to step/review and assigned to @Vylpes. Retry/disable monitoring left for #535.

Implemented on `cursor/534-rss-feed-checker-timer` (from `feature/epic-528-rss-feeds`). PR ready for review: https://git.vylpes.xyz/RabbitLabs/vylbot-app/pulls/592 - Cron `*/15 * * * *` Europe/London via `RssTimer` - Posts new items oldest-first; updates `LastFetchedItemGuid` after each successful post - Fetch failures → `AppLogger.error` + danger embed in the feed channel - Local: `yarn build` / `yarn test` PASS (8 suites / 97 tests) Moved to `step/review` and assigned to @Vylpes. Retry/disable monitoring left for #535.
Smithy-bot removed their assignment 2026-10-26 11:08:01 +00:00
Smithy-bot added spent time 2026-10-26 11:08:14 +00:00
5 minutes
Vylpes added spent time 2026-10-26 21:31:45 +00:00
10 minutes
Vylpes removed their assignment 2026-10-26 21:31:55 +00:00
Author
Owner

@Smithy-bot I've left some comments on the PR for you to resolve.

@Smithy-bot I've left some comments on the PR for you to resolve.
Member

Addressed the PR review comments on #592 (commit 850da44):

  1. Removed AppLogger — deleted src/helpers/AppLogger.ts. Errors now use console.error (same pattern as AutoKick). Proper logging deferred to a future story.
  2. ChannelHelper.ResolveSendable — new helper at src/helpers/ChannelHelper.ts; RssTimer uses it for feed + error posting.
  3. RssFeedHelper.BuildItemEmbed — item embed builder moved out of the timer for reuse (e.g. a future manual send command).

Local: yarn build + yarn test PASS (9 suites / 102 tests).

Other places ChannelHelper could be reused

Closest match (resolve by id + sendable check), same pattern as the extracted helper:

  • src/timers/AutoKick.ts — notice channel lookup ×2 (guild.channels.cache.find / fetch + isSendable)

Related but different today (lookup by name, then cast to TextChannel — would need a name-based helper or ID migration first):

  • Moderation audit channels: src/commands/ban.ts, kick.ts, warn.ts, timeout.ts
  • Join/leave/nickname/message log channels: GuildMemberAdd, GuildMemberRemove, NicknameChanged, MessageDelete, MessageUpdate
  • VerificationCheck verification channel lookup

Happy to refactor AutoKick onto ChannelHelper in a follow-up if you want that in this PR instead.

Leaving at step/review for you — did not approve or merge.

Addressed the PR review comments on https://git.vylpes.xyz/RabbitLabs/vylbot-app/pulls/592 (commit `850da44`): 1. **Removed `AppLogger`** — deleted `src/helpers/AppLogger.ts`. Errors now use `console.error` (same pattern as `AutoKick`). Proper logging deferred to a future story. 2. **`ChannelHelper.ResolveSendable`** — new helper at `src/helpers/ChannelHelper.ts`; `RssTimer` uses it for feed + error posting. 3. **`RssFeedHelper.BuildItemEmbed`** — item embed builder moved out of the timer for reuse (e.g. a future manual send command). Local: `yarn build` + `yarn test` PASS (9 suites / 102 tests). ### Other places `ChannelHelper` could be reused Closest match (resolve by **id** + sendable check), same pattern as the extracted helper: - `src/timers/AutoKick.ts` — notice channel lookup ×2 (`guild.channels.cache.find` / `fetch` + `isSendable`) Related but different today (lookup by **name**, then cast to `TextChannel` — would need a name-based helper or ID migration first): - Moderation audit channels: `src/commands/ban.ts`, `kick.ts`, `warn.ts`, `timeout.ts` - Join/leave/nickname/message log channels: `GuildMemberAdd`, `GuildMemberRemove`, `NicknameChanged`, `MessageDelete`, `MessageUpdate` - `VerificationCheck` verification channel lookup Happy to refactor `AutoKick` onto `ChannelHelper` in a follow-up if you want that in this PR instead. Leaving at `step/review` for you — did not approve or merge.
Smithy-bot stopped working 2026-10-27 11:05:56 +00:00
2 minutes 8 seconds
Smithy-bot removed their assignment 2026-10-27 11:05:56 +00:00
Member

Opened follow-up for ChannelHelper reuse: #593

Opened follow-up for ChannelHelper reuse: #593
Vylpes removed their assignment 2026-10-27 13:06:45 +00:00
Member

QA on feature/epic-528-rss-feeds @ 0f38242 (PR #592 merged).

Results

  • yarn install --frozen-lockfile PASS
  • yarn build (tsc) PASS
  • yarn test PASS — 9 suites / 102 tests / 2 snapshots
  • tests/timers/RssTimer.test.ts covers AC: cron-driven fetch of all feeds, post new items oldest-first with LastFetchedItemGuid updates, fetch failure → console.error + danger embed (AppLogger removed per review; logging deferred)
  • Wired in src/client/client.ts: AddTimer("*/15 * * * *", "Europe/London", RssTimer, false)
  • lint N/A on this branch (no yarn lint script)

Note: Code is on the epic feature branch, not yet on release/3.4.0.

Moving step/testing → step/uat. Live Discord 15-minute feed smoke left for human UAT.

QA on `feature/epic-528-rss-feeds` @ `0f38242` (PR #592 merged). **Results** - `yarn install --frozen-lockfile` PASS - `yarn build` (tsc) PASS - `yarn test` PASS — 9 suites / 102 tests / 2 snapshots - `tests/timers/RssTimer.test.ts` covers AC: cron-driven fetch of all feeds, post new items oldest-first with `LastFetchedItemGuid` updates, fetch failure → `console.error` + danger embed (AppLogger removed per review; logging deferred) - Wired in `src/client/client.ts`: `AddTimer("*/15 * * * *", "Europe/London", RssTimer, false)` - lint N/A on this branch (no `yarn lint` script) **Note:** Code is on the epic feature branch, not yet on `release/3.4.0`. Moving `step/testing` → `step/uat`. Live Discord 15-minute feed smoke left for human UAT.
Smithy-bot stopped working 2026-10-28 11:06:40 +00:00
47 seconds
Smithy-bot removed their assignment 2026-10-28 11:06:40 +00:00
Smithy-bot added spent time 2026-10-28 11:07:02 +00:00
1 minute
Vylpes 2026-10-28 12:52:41 +00:00
  • closed this issue
  • removed the
    step
    uat
    label
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Total time spent: 19 minutes 43 seconds
Smithy-bot
9 minutes 43 seconds
Vylpes
10 minutes
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
Reference
RabbitLabs/vylbot-app#534
No description provided.