Skip to content

Phase 3: scheduled background checks + Discord notifications#10

Merged
StrandedTurtle merged 1 commit into
mainfrom
claude/phase3-scheduler-discord
Jun 26, 2026
Merged

Phase 3: scheduled background checks + Discord notifications#10
StrandedTurtle merged 1 commit into
mainfrom
claude/phase3-scheduler-discord

Conversation

@StrandedTurtle

Copy link
Copy Markdown
Owner

Replaces Diun's scheduled ping with our own — the last piece that made Diun necessary.

What's new

  • scheduler.js — a setInterval background checker that runs the same registry check the "Check for updates" button triggers, on a configurable interval. Re-armed when settings change, overlap-guarded, started on boot / stopped on graceful shutdown. No cron dependency.
  • notify.js — formats a concise "updates available" Discord message and POSTs it to a webhook (pure payload builder + sender, both unit-tested).
  • Dedupe — a notified column on update_events (added via migration) so each update is announced once; a new digest re-notifies.
  • Settings gain backgroundCheckEnabled, backgroundCheckIntervalHours, discordEnabled, discordWebhookUrl — env-seedable (BACKGROUND_CHECK_ENABLED, CHECK_INTERVAL_HOURS, DISCORD_WEBHOOK_URL), UI overrides at runtime.
  • POST /api/notify/test + a Send test message button, and a new "Background checks & Discord" Settings section.

Defaults

Background checks on, every 6h. Discord off until you paste a webhook URL.

Test plan

  • cd server && node --test → 68/68 (added settings-validation + notify-payload tests)
  • cd client && npm run build → clean
  • server boots with the scheduler started; shuts down cleanly
  • Host: set a short interval + a webhook, "Send test" posts; a real new update posts once (not on every check)

Next

Phase 4 — the fetched changelog "what's changed" panel (this already added the per-card source/changelog link in Phase 2).


Generated by Claude Code

Replace Diun's scheduled ping with our own. New modules:
- scheduler.js — a setInterval-based background checker that runs the same
  registry check the button triggers, on a configurable interval; re-armed
  when settings change, overlap-guarded, started on boot / stopped on
  shutdown.
- notify.js — formats a concise "updates available" Discord message and
  POSTs it to a webhook (pure payload builder + sender).

Dedupe: a `notified` column on update_events (added via migration) so each
update is announced once; new digests re-notify.

Settings gain backgroundCheckEnabled, backgroundCheckIntervalHours,
discordEnabled, discordWebhookUrl (env-seedable: BACKGROUND_CHECK_ENABLED,
CHECK_INTERVAL_HOURS, DISCORD_WEBHOOK_URL). New POST /api/notify/test + get
a "Send test message" button. Settings page gains a "Background checks &
Discord" section. Docs + API_CONTRACT updated.

Server tests 68/68; client builds clean.
@StrandedTurtle StrandedTurtle merged commit 319afb1 into main Jun 26, 2026
4 checks passed
@StrandedTurtle StrandedTurtle deleted the claude/phase3-scheduler-discord branch June 26, 2026 09:53
@StrandedTurtle StrandedTurtle restored the claude/phase3-scheduler-discord branch June 26, 2026 09:53
@StrandedTurtle StrandedTurtle deleted the claude/phase3-scheduler-discord branch June 26, 2026 09:54
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