18036d53bf
Fix issue #31 : Make schedule reschedule deterministic and observable
...
Replace fire-and-forget reschedule pattern with proper async/await:
- Changed reschedule() from fire-and-forget to awaitable async function
- Errors are now properly propagated instead of silently failing
- Added structured logging for reschedule start and completion
- Schedule updates are now deterministic and observable to callers
Changes:
- app/tasks/blocklist_import.py: Convert reschedule to async, remove asyncio.ensure_future
- tests/test_tasks/test_blocklist_import.py: Add tests for error propagation and logging
- Docs/Features.md: Document scheduling reliability guarantees
All 15 blocklist_import tests pass with 100% coverage.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-04-29 19:24:55 +02:00
5e5d7c34b2
Document task DB access and unify background task DB handling
2026-04-17 17:18:49 +02:00
8c6950afc1
Task 13: move ban_ip, unban_ip, and get_active_bans from jail_service to ban_service and update routers/tests
2026-04-17 16:22:20 +02:00
73cc212e28
Invert blocklist scheduler dependency to task callback
2026-04-15 21:31:08 +02:00
b70dc6fa7a
Refactor blocklist schedule management into service
2026-04-14 15:25:36 +02:00
a564830abb
Fix blocklist service injection and centralize session cookie name
2026-04-14 09:21:38 +02:00
ae81a8f5be
Refactor periodic tasks to use injected scheduler resources
2026-04-11 20:32:36 +02:00
9cba5a9fcb
Refactor blocklist import registration to async startup flow
2026-04-11 20:07:00 +02:00
3b6e39ddad
Separate bootstrap settings from runtime overrides with a dedicated runtime settings manager
2026-04-10 19:31:51 +02:00
e21f153946
Remove dead task DB fast-path and update task tests
2026-04-07 20:00:13 +02:00
42c030c706
Refactor backend to use request-scoped SQLite connections
2026-04-05 23:14:46 +02:00
bf2abda595
chore: commit local changes
2026-03-22 14:24:32 +01:00
1cdc97a729
Stage 11: polish, cross-cutting concerns & hardening
...
- 11.1 MainLayout health indicator: warning MessageBar when fail2ban offline
- 11.2 formatDate utility + TimezoneProvider + GET /api/setup/timezone
- 11.3 Responsive sidebar: auto-collapse <640px, media query listener
- 11.4 PageFeedback (PageLoading/PageError/PageEmpty), BanTable updated
- 11.5 prefers-reduced-motion: disable sidebar transition
- 11.6 WorldMap ARIA: role/tabIndex/aria-label/onKeyDown for countries
- 11.7 Health transition logging (fail2ban_came_online/went_offline)
- 11.8 Global handlers: Fail2BanConnectionError/ProtocolError -> 502
- 11.9 379 tests pass, 82% coverage, ruff+mypy+tsc+eslint clean
- Timezone endpoint: setup_service.get_timezone, 5 new tests
2026-03-01 15:59:06 +01:00
1efa0e973b
Stage 10: external blocklist importer — backend + frontend
...
- blocklist_repo.py: CRUD for blocklist_sources table
- import_log_repo.py: add/list/get-last log entries
- blocklist_service.py: source CRUD, preview, import (download/validate/ban),
import_all, schedule get/set/info
- blocklist_import.py: APScheduler task (hourly/daily/weekly schedule triggers)
- blocklist.py router: 9 endpoints (list/create/update/delete/preview/import/
schedule-get+put/log)
- blocklist.py models: ScheduleFrequency (StrEnum), ScheduleConfig, ScheduleInfo,
ImportSourceResult, ImportRunResult, PreviewResponse
- 59 new tests (18 repo + 19 service + 22 router); 374 total pass
- ruff clean, mypy clean for Stage 10 files
- types/blocklist.ts, api/blocklist.ts, hooks/useBlocklist.ts
- BlocklistsPage.tsx: source management, schedule picker, import log table
- Frontend tsc + ESLint clean
2026-03-01 15:33:24 +01:00