Phase 3: scheduled background checks + Discord notifications#10
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces Diun's scheduled ping with our own — the last piece that made Diun necessary.
What's new
scheduler.js— asetIntervalbackground 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).notifiedcolumn onupdate_events(added via migration) so each update is announced once; a new digest re-notifies.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→ cleanNext
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