Skip to content

Keep FBNS connected on read timeout#2717

Merged
subzeroid merged 1 commit into
masterfrom
fix/fbns-read-timeout-state
Jul 1, 2026
Merged

Keep FBNS connected on read timeout#2717
subzeroid merged 1 commit into
masterfrom
fix/fbns-read-timeout-state

Conversation

@subzeroid

Copy link
Copy Markdown
Owner

What

  • Keep FbnsClient.connected true when a read attempt raises TimeoutError.
  • Preserve the existing behavior where closed sockets / transport failures mark FBNS disconnected.
  • Add regression coverage for the timeout path.

Why

A read timeout means no MQTT packet arrived before the socket timeout; it does not prove the socket is closed. The previous cleanup fix treated every _recv_packet() exception as fatal.

Verification

  • RED: PYTHONDONTWRITEBYTECODE=1 .venv/bin/pytest -q tests/regression/test_fbns.py::test_fbns_read_once_keeps_client_connected_on_socket_timeout failed before the fix with fbns.connected false.
  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/ruff check instagrapi/realtime/fbns.py tests/regression/test_fbns.py
  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/pytest -q tests/regression/test_fbns.py
  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/pytest -q tests/regression

Mirror of subzeroid/aiograpi#403 / subzeroid/aiograpi#402.

@subzeroid subzeroid merged commit db6c43f into master Jul 1, 2026
12 checks passed
@subzeroid subzeroid deleted the fix/fbns-read-timeout-state branch July 1, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant