Catching dev up to main#69
Conversation
Reorganized architecture section and removed unnecessary details.
Knip Code AnalysisFound 29 total issues
View details
Use |
There was a problem hiding this comment.
Pull request overview
This PR appears to bring a long-lived dev branch back in sync with main, including a sizeable feature addition: a notifications/webhooks system (Discord-first), plus accompanying schema, scheduler integration, docs site (MkDocs), and various refactors/cleanup.
Changes:
- Add notification targets + delivery cooldown state (DB schema), notification dispatch/delivery pipeline, and scheduler hooks to emit events during polling.
- Add a MkDocs-based documentation site + GitHub Actions deploy workflow, and link docs from the UI/README.
- Refactor tracker alert/event detection into shared pure functions and expand tracker stats typing/serialization.
Reviewed changes
Copilot reviewed 101 out of 117 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/css.d.ts | Add CSS module declaration file for TS tooling. |
| src/types/api.ts | Extend TrackerLatestStats with new stat fields. |
| src/lib/tracker-status.ts | Use shared checkWarned helper for health computation. |
| src/lib/tracker-serializer.ts | Serialize dates/colors consistently; add new stat fields to API response. |
| src/lib/tracker-events.ts | New shared pure functions for event/alert detection + snooze durations. |
| src/lib/scheduler.ts | Fetch enabled notification targets once per poll cycle; dispatch notifications on success/failure. |
| src/lib/nuke.ts | Scrub/delete notification tables during nuke. |
| src/lib/notifications/validate.ts | New per-target config validation (Discord webhook + SSRF defense-in-depth). |
| src/lib/notifications/types.ts | New notification type + event type definitions. |
| src/lib/notifications/payload.ts | Build Discord embed payloads for notification events. |
| src/lib/notifications/dispatch.ts | Detect events, enforce cooldowns, decrypt config, deliver, and persist delivery status. |
| src/lib/notifications/deliver.ts | Deliver Discord webhooks with circuit breaker + rate-limit handling. |
| src/lib/notifications/decrypt.ts | Server-only decrypt helper for notification target configs. |
| src/lib/formatters.test.ts | Update TrackerLatestStats test fixture for new fields. |
| src/lib/db/schema.ts | Add notificationTargets + notificationDeliveryState tables. |
| src/lib/dashboard.ts | Replace inline alert logic with shared tracker-events checks. |
| src/lib/constants.ts | Add centralized docs URL/entries for linking from UI. |
| src/lib/backup.ts | Include notification targets in backups (excluding transient delivery status columns). |
| src/lib/tests/tracker-serializer.test.ts | Add tests for new serialized tracker stat fields. |
| src/lib/tests/notification-delivery.test.ts | Add tests for webhook delivery circuit breaker behavior. |
| src/lib/tests/core-stat-alerts.test.ts | Update stats fixture to include new fields. |
| src/lib/tests/circuit-breaker.test.ts | Mock notification dispatch; update DB select mocking for new orderBy. |
| src/components/ui/StatCard.tsx | Remove explicit "use client" marker. |
| src/components/settings/SecuritySection.tsx | Add docs link for TOTP settings section. |
| src/components/settings/ProxySection.tsx | Add docs link for proxy settings section. |
| src/components/settings/BackupsSection.tsx | Add docs link for backups section. |
| src/components/layout/Sidebar.tsx | Add “Docs” link in sidebar. |
| src/components/dashboard/RankProgress.tsx | Use shared anniversary milestone check. |
| src/components/charts/UploadPolarChart.tsx | Rework polar visualization to a custom-sector heatmap-like rendering. |
| src/components/TagGroups.tsx | Add docs link for Tag Groups section. |
| src/components/QbitmanageSettings.tsx | Add docs link for qbitmanage settings. |
| src/app/api/settings/backup/restore/route.ts | Restore notificationTargets (with optional re-encryption) and clear notification tables before restore. |
| src/app/api/notifications/route.ts | Add API for listing/creating notification targets (never returns encrypted config). |
| src/app/api/notifications/[id]/test/route.ts | Add endpoint to send a test notification and update last-delivery status on success. |
| src/app/api/notifications/[id]/route.ts | Add PATCH/DELETE for notification targets (toggles, thresholds, scope, config updates). |
| src/app/(auth)/settings/page.tsx | Refactor Settings page to server-load data and render a SettingsClient component. |
| scripts/upgrade-pg17-to-18.sh | Remove the Postgres upgrade script. |
| package.json | Update version and add package metadata + Node engine requirement. |
| docs/kb/requirements.txt | Add MkDocs Material dependency constraints. |
| docs/kb/mkdocs.yml | Add MkDocs site configuration + navigation. |
| docs/kb/docs/troubleshooting/tracker-offline.md | New troubleshooting doc page. |
| docs/kb/docs/troubleshooting/ratio-not-updating.md | New troubleshooting doc page. |
| docs/kb/docs/troubleshooting/common-errors.md | New troubleshooting doc page. |
| docs/kb/docs/trackers/adding-a-tracker.md | New “Adding a tracker” doc page. |
| docs/kb/docs/reference/stats-explained.md | New stats reference doc page. |
| docs/kb/docs/reference/settings.md | New settings reference doc page. |
| docs/kb/docs/reference/platform-differences.md | New platform differences doc page. |
| docs/kb/docs/index.md | New docs homepage. |
| docs/kb/docs/getting-started/installation.md | New installation doc page. |
| docs/kb/docs/getting-started/first-setup.md | New first setup doc page. |
| docs/kb/docs/getting-started/docker-config.md | New Docker config doc page. |
| docs/kb/docs/features/webhooks.md | New notifications/webhooks doc page. |
| docs/kb/docs/features/totp.md | New TOTP doc page. |
| docs/kb/docs/features/tag-groups.md | New tag groups doc page. |
| docs/kb/docs/features/qbitmanage.md | New qbitmanage integration doc page. |
| docs/kb/docs/features/proxies.md | New proxy support doc page. |
| docs/kb/docs/features/download-clients.md | New download clients doc page. |
| docs/kb/docs/features/backups.md | New backups doc page. |
| docs/kb/docs/contributing/trackers/uploadcx.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/skipthecommercials.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/reelflix.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/redacted.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/racing4everyone.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/phoenixproject.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/passthepopcorn.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/orpheus.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/onlyencodes.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/oldtoons.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/nebulance.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/morethantv.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/lst.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/greatposterwall.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/gazellegames.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/fearnopeer.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/empornium.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/concertos.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/broadcasthenet.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/blutopia.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/anthelion.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/animebytes.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/alpharatio.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/trackers/aither.md | New per-tracker contributing doc. |
| docs/kb/docs/contributing/tracker-responses.md | New adapter/response reference docs. |
| docs/kb/docs/contributing/tracker-responses-unit3d.md | New UNIT3D response reference docs. |
| docs/kb/docs/contributing/tracker-responses-ggn.md | New GGn response reference docs. |
| docs/kb/docs/contributing/tracker-responses-gazelle.md | New Gazelle response reference docs. |
| docs/kb/docs/contributing/index.md | New contributing docs + repo conventions. |
| docs/kb/docs/assets/images/.gitkeep | Keep docs assets folder in git. |
| docker-compose.yml | Update compose header/comments and tweak env/comment defaults. |
| README.md | Link to docs and reorganize architecture section. |
| CHANGELOG.md | Add entries for 2.1.x/2.0.2. |
| .markdownlint.json | Disable MD025 as well. |
| .gitignore | Simplify data ignore, ignore .vscode/, ignore mkdocs build output. |
| .github/workflows/security-audit.yml | Increase minimum security test count threshold. |
| .github/workflows/release.yml | Add Docker Hub login + publish images to Docker Hub. |
| .github/workflows/docs.yml | New workflow to build and deploy docs via MkDocs. |
| .env.example | Reorder/clarify env examples and defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { getSettingsForClient, getTrackerListForDashboard } from "@/lib/server-data" | ||
| import { SettingsClient } from "./SettingsClient" | ||
|
|
There was a problem hiding this comment.
SettingsClient is imported from "./SettingsClient" but there is no SettingsClient module in src/app/(auth)/settings/ (and no other SettingsClient export found in the repo). This will fail the Next.js build at module resolution time. Add the missing SettingsClient file/export, or revert to the previous in-file client implementation / adjust the import path to the correct location.
| case "buffer_milestone": | ||
| return { bufferBytes: Number(ctx.currentBufferBytes ?? 0n) } | ||
| case "warned": |
There was a problem hiding this comment.
buffer_milestone event data converts bigint buffer bytes to a JS number via Number(...). For large buffers this can exceed Number.MAX_SAFE_INTEGER and silently lose precision, which can make the formatted byte label inaccurate. Consider keeping this as a decimal string (or formatting from bigint directly) all the way through the notification payload/description building.
| await tx.update(notificationTargets).set({ | ||
| encryptedConfig: randomHex(64), | ||
| name: randomHex(8), | ||
| lastDeliveryError: null, | ||
| }) |
There was a problem hiding this comment.
scrubAndDeleteAll() updates notificationTargets to randomize sensitive fields and then deletes notificationTargets in the same transaction. Since the rows are removed immediately afterward, the update is redundant (and adds write overhead). Consider either removing the update, or keeping the update but only if you no longer delete the targets (i.e., if you intend to retain rows but scrub secrets).
No description provided.