wrongmove/api
Viktor Barzin 791b5a9d55
Fix real-time task progress by closing WS on pubsub exit and keeping polling active
Three interconnected bugs prevented progress updates from reaching the frontend:

1. _forward_pubsub could exit silently while _handle_client_messages kept
   the WebSocket alive (responding to pings), so the client never detected
   the broken forwarding path. Replace asyncio.gather with asyncio.wait
   (FIRST_COMPLETED) so both coroutines are cancelled together.

2. Polling was stopped on WS connect with no fallback if forwarding broke.
   Now polling runs always alongside WebSocket as a safety net.

3. Redis publish failures in task_progress_publisher were logged at DEBUG
   and the broken client was reused forever. Log at WARNING and reset the
   client so the next call reconnects.
2026-02-09 22:48:57 +00:00
..
app.py Fix duplicate listings via staged Redis cache and frontend stream cancellation 2026-02-09 21:17:30 +00:00
audit_middleware.py Add API rate limiting, metrics guard, and audit middleware 2026-02-08 00:45:43 +00:00
auth.py Flatten repo structure: move crawler/ to root, remove vqa/ and immoweb/ 2026-02-07 23:01:20 +00:00
config.py Harden backend security: IDOR fix, error sanitization, rate limiter fallback, security headers 2026-02-08 19:42:30 +00:00
metrics.py Flatten repo structure: move crawler/ to root, remove vqa/ and immoweb/ 2026-02-07 23:01:20 +00:00
metrics_guard.py Add API rate limiting, metrics guard, and audit middleware 2026-02-08 00:45:43 +00:00
origin_validator.py Add API anti-abuse hardening: disable docs in prod, origin validator, exception handler 2026-02-08 20:06:46 +00:00
passkey_routes.py Harden backend security: IDOR fix, error sanitization, rate limiter fallback, security headers 2026-02-08 19:42:30 +00:00
poi_routes.py Harden backend security: IDOR fix, error sanitization, rate limiter fallback, security headers 2026-02-08 19:42:30 +00:00
rate_limit_config.py Harden backend security: IDOR fix, error sanitization, rate limiter fallback, security headers 2026-02-08 19:42:30 +00:00
rate_limiter.py Harden backend security: IDOR fix, error sanitization, rate limiter fallback, security headers 2026-02-08 19:42:30 +00:00
security_headers.py Harden backend security: IDOR fix, error sanitization, rate limiter fallback, security headers 2026-02-08 19:42:30 +00:00
ws_routes.py Fix real-time task progress by closing WS on pubsub exit and keeping polling active 2026-02-09 22:48:57 +00:00