Skip to content

[Bug] UI freezes at ~4:45 behind reverse proxies (Regression in v2.1.2) #106

Description

@nbolland

Summary

In version v2.1.2, replay/telemetry streaming connections consistently drop and freeze the UI around the 4 minutes and 45 seconds (~285–300s) mark when deployed behind a reverse proxy (e.g., Nginx, Traefik, Cloudflare Tunnels, VPS) or within containerized proxy environments.

Technical Root Cause

This issue correlates directly with the PORT binding change introduced in v2.1.2:

"PORT ignored in Docker — setting PORT published one port but left the container listening on 8000..."

  • In v2.1.1: The container always listened internally on port 8000 regardless of the $PORT variable, and persistent streaming connections through ingress proxies remained open without dropping.
  • In v2.1.2: Uvicorn now dynamically binds to $PORT inside the container. In reverse proxy setups, this shift alters how host/forwarded headers and socket upgrades are negotiated between Uvicorn and the proxy.
  • Proxy Timeout Clock Trigger: Because of this negotiation shift, the proxy fails to treat the stream as an active persistent socket and falls back to standard HTTP buffering. Once the proxy's default 300-second (5-minute) idle timeout clock expires without recognized keep-alive traffic, the proxy forcibly severs the link around the 4:45 mark, permanently freezing the UI.

Steps to Reproduce

  1. Deploy f1replaytiming:v2.1.2 behind any standard reverse proxy or container host enforcing default proxy timeouts (e.g., Nginx, Traefik, Cloudflare Tunnel, VPS).
  2. Open the app in a browser and launch any session replay.
  3. Allow the stream to play continuously.
  4. Result: The telemetry stream abruptly drops and the track/timing data freezes the UI permanently at ~04:45.

Expected Behavior

The stream connection should maintain an open, unbuffered connection through reverse proxies and continue playing past the 5-minute mark without dropping, matching the behavior in v2.1.1.

Suggested Solution

Consider implementing an active heartbeat pulse (e.g., periodic WebSocket ping/pong frames or SSE keep-alive comments sent every 15–30 seconds) during playback. Sending regular keep-alive traffic prevents downstream proxies and ingress load balancers from hitting their 300-second idle connection timeouts.

Additional Context / Regression

Rolling back the deployment image to v2.1.1 completely resolves the issue under identical hosting configurations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions