7690d959b3
CI / Security audit (push) Successful in 1m52s
Docs Check / Markdown lint (push) Successful in 1m37s
Build and Push Docker Image / build (push) Successful in 2m2s
Licence Check / Licence compatibility and copyright header verification (push) Failing after 2m33s
CI / Swagger Validation & Coverage (push) Successful in 3m17s
Docs Check / Mermaid diagram parse check (push) Successful in 3m31s
CI / Tests & coverage (push) Successful in 4m5s
Fixes the root cause of the regression from v1.7.16. The v1.7.16 fix correctly cast arrQueueId to String, but the lookup was performed against downloadClientRegistry.getAllDownloads() which returns raw download client data (qBittorrent, SABnzbd, etc.) that never has arrQueueId populated. The fix now looks up the queue record directly from the Sonarr/Radarr queue cache where record.id is the numeric queue ID, using String() casting on both sides to handle the DOM-dataset (string) vs API response (number) type difference. Resolves Gitea Issue #48 Closes #48
17 lines
1.4 KiB
Plaintext
17 lines
1.4 KiB
Plaintext
Title:
|
|
FEATURE: Client-side console log capturing and streaming API endpoint with dual-authentication
|
|
|
|
Problem / Requirement:
|
|
To aid in frontend troubleshooting, developers need a way to capture and gather client-side console logs (`console.log`, `console.warn`, `console.error`) and make them accessible over a real-time log stream endpoint. This helps debug frontend issues (such as SSE failures, CSP violations, and state synchronization issues) in environments without direct access to browser devtools.
|
|
|
|
Success Criteria:
|
|
1. Client-Side Interceptor: Intercept standard browser console methods at SPA startup and place captured logs into an in-memory queue.
|
|
2. Batched Log Transmission (Selected Option A): Periodic HTTP POST batch queries to `POST /api/debug/client-logs` (every 2 seconds or when the queue hits 20 items) to minimize browser thread and network overhead.
|
|
3. Server storage and SSE log streaming:
|
|
- Save incoming logs into a separate rolling 1000-line buffer `clientLogBuffer`.
|
|
- Expose `GET /api/debug/client-logs/stream` to stream client-side logs in real-time via SSE.
|
|
4. Security & Configuration:
|
|
- Enableable only when the environment variable `ENABLE_LOG_STREAM=true` is set.
|
|
- Enforce exact same dual-auth rules (Emby session cookie, Basic Auth fallback, and X-Webhook-Secret header bypass) on both client logs endpoints.
|
|
5. API Documentation: Documented in `server/openapi.yaml`.
|