Bug-Fixing Analyse Fehler #87
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "develop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Frontend: - api.js Zeile 487: localStorage.getItem('token') → getToken() - Token heißt 'bodytrack_token', nicht 'token' - SSE-Requests bekamen undefined token → 401 Unauthorized Root Cause: - Admin verwendet executeUnifiedPrompt (normaler Request mit Header-Auth) - Analyse verwendet executeUnifiedPromptStream (SSE mit Token im URL) - SSE bekam keinen Token wegen falschem localStorage key Fixes: - "Connection to server lost" in Analyse-Seite Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>ROOT CAUSE FOUND: FastAPI matches routes in ORDER. The catch-all route /{prompt_id} at line 257 matches /execute-stream BEFORE the specific route at line 1448 can match. Result: /api/prompts/execute-stream gets routed to get_prompt() which tries to parse 'execute-stream' as a UUID, causing the error we've been seeing. SOLUTION: Move /execute-stream route definition to BEFORE line 257 (before /{prompt_id}) This explains why require_auth_flexible was never called - the wrong endpoint was being invoked entirely.- /execute-stream now at line 260 (was 1448) - /{prompt_id} now at line 410 (was 257) - FastAPI will now match /execute-stream correctly - Fixes 'Connection to server lost' error in analysis pageRoot cause: FastAPI matches routes in definition order. The /{prompt_id} catch-all at line 257 was intercepting /execute-stream requests before the specific route handler could match. Fix: Moved execute-stream definition (with section header + imports) to line 257, before the catch-all route (now at line 414). This resolves the 'Connection to server lost' error in SSE streaming.