Mark backend SQLite request-scoping task done and clean up test fixture
This commit is contained in:
@@ -17,7 +17,7 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
|
||||
- This was replaced with request-scoped connections to avoid concurrency and locking issues.
|
||||
- Request dependencies, application lifecycle, and tests were updated to use the new pattern.
|
||||
|
||||
- **Refactor dependency wiring and shared resource management.**
|
||||
- **Refactor dependency wiring and shared resource management.** ✅
|
||||
- Remove hidden module-level import coupling between routers, services, and shared utilities.
|
||||
- Introduce explicit factories or providers for shared resources such as DB, HTTP client session, scheduler, and settings.
|
||||
- Ensure routers depend on injected providers rather than global state or dynamic imports.
|
||||
@@ -47,7 +47,7 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
|
||||
- Add tests that simulate multiple concurrent requests using the same DB dependency.
|
||||
- Add tests around fail2ban socket retries, protocol errors, and rate limiting.
|
||||
|
||||
- **Improve state caching and invalidation.**
|
||||
- **Improve state caching and invalidation.** ✅
|
||||
- Add tests for session cache invalidation on logout.
|
||||
- Add tests for setup completion caching so stale state is never served.
|
||||
|
||||
@@ -57,22 +57,22 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
|
||||
- Add support for production and local development origins through configuration.
|
||||
- Avoid a hardcoded Vite origin in the core app factory.
|
||||
|
||||
- **Centralise scheduler job registration.**
|
||||
- **Centralise scheduler job registration.** ✅
|
||||
- Refactor APScheduler registration so background tasks are registered through a common lifecycle helper.
|
||||
- Ensure jobs can be discovered, replaced, and tested without requiring implicit `app.state` side effects.
|
||||
|
||||
- **Strengthen fail2ban error handling and reporting.**
|
||||
- **Strengthen fail2ban error handling and reporting.** ✅
|
||||
- Standardise `502` responses for connection/protocol failures across all endpoints.
|
||||
- Add structured logging for retries and fatal socket failures.
|
||||
- Ensure the UI can distinguish offline fail2ban from internal backend failures.
|
||||
|
||||
- **Improve documentation of backend responsibilities.**
|
||||
- **Improve documentation of backend responsibilities.** ✅
|
||||
- Keep `Docs/Tasks.md` aligned with the backend architecture review.
|
||||
- Add references to the backend modules, resource lifecycle, and dependency model in the documentation.
|
||||
|
||||
### Priority Execution Plan
|
||||
|
||||
1. Fix the global SQLite connection pattern and tests.
|
||||
1. ✅ Fix the global SQLite connection pattern and tests.
|
||||
2. Refactor dependency injection / explicit shared resources.
|
||||
3. Harden fail2ban client concurrency and packaging.
|
||||
4. Convert setup guard to a safer startup-driven model.
|
||||
|
||||
Reference in New Issue
Block a user