refactoring-backend #3

Merged
lukas.pupkalipinski merged 403 commits from refactoring-backend into main 2026-05-20 20:23:46 +02:00
Showing only changes of commit 2331567bd7 - Show all commits

View File

@@ -1,33 +1,3 @@
## TASK-012 — `SetupGuard` fires duplicate API calls on mount
**Severity:** Low
### Where found
Frontend setup guard component — the setup status check is performed by multiple consumers independently on mount, resulting in duplicate `GET /api/setup` requests.
### Why this is needed
Duplicate API calls on mount create unnecessary backend load and introduce potential race conditions where both calls return slightly different states. It also increases perceived load time.
### Goal
Deduplicate the setup status check so all consumers share a single in-flight request.
### What to do
1. Move the setup status fetch into a shared React Query (`useQuery`) call keyed by `"setupStatus"`.
2. Any component that needs the setup status reads from the same query cache — React Query deduplicates concurrent requests automatically.
3. Remove any direct `fetch` calls for setup status that bypass the shared query.
### Possible traps and issues
- React Query must be installed and configured at the app root.
- The cache TTL for setup status should be relatively short (e.g., 30 seconds) or invalidated after a successful setup completion.
### Docs changes needed
- `Web-Development.md` — data-fetching conventions (use React Query, not raw `fetch`).
### Doc references
- [Web-Development.md](Web-Development.md) — data fetching patterns
---
## TASK-013 — nginx missing security response headers
**Severity:** High