HTTP transport: drop WS server, offline send queue + dead-stream watchdog
Gateway (docs/19): - Remove ws_server.py; frame dispatch factored into dispatch.py - http_server: media upload/pull, pairing over HTTP - protocol: media frames mirrored; tests + ws_probe updated for HTTP App: - HttpGateway: postFrame/uploadMedia/pullMedia no longer throw on network failure (PostResult ok=false / Result.failure) — uncaught SocketTimeoutException on Dispatchers.Default crashed the app - GatewayClient: dead-stream watchdog (health probe every 10s, 2 failures -> redial in ~20s instead of the 45s SSE read timeout); state flips to Reconnecting when the stream dies, restored from the last hello.ack on long-poll success; poke() + backoff reset on app resume (MainActivity.onResume) - Offline sends: composer enabled while disconnected; a send with no response (status 0) stays queued (Pending) and is auto-resent on the next (re)connect after a 2s outbox-replay grace; gateway 4xx rejections fail the bubble (tap to retry, no auto-loop) - ChatStore: echo-replace and thread-relocate also match Failed bubbles (POST response lost in a network drop); loadHistory dedupes local failed bubbles the server already has; failMessage() - MainActivity: poke() on resume so a backgrounded app reconnects promptly instead of waiting out the backoff
This commit is contained in:
1 parent
2349a95dd4
commit
e6015033b6
22 files changed
+2804
-2439
No files matched your search
@@ -45,7 +45,7 @@ def verify_token(provided: str | None, expected: str | None) -> bool:
|
||||
def qr_payload(host: str, port: int, token: str, secure: bool = False) -> str:
|
||||
"""Pairing URL encoded into the QR / pre-filled into the app.
|
||||
|
||||
``iris://pair?host=<lan-ip>&port=8790&token=<token>`` — the app's
|
||||
``iris://pair?host=<lan-ip>&port=8791&token=<token>`` — the app's
|
||||
Connect screen parses this to pre-fill settings (docs/09 §9.2).
|
||||
"""
|
||||
return (
|
||||
@@ -57,9 +57,9 @@ def qr_payload(host: str, port: int, token: str, secure: bool = False) -> str:
|
||||
|
||||
|
||||
def pairing_url(host: str, port: int, secure: bool = False) -> str:
|
||||
"""Plain ws(s) URL the app connects to (shown next to the QR)."""
|
||||
scheme = "wss" if secure else "ws"
|
||||
return f"{scheme}://{host}:{int(port)}/ws"
|
||||
"""Plain http(s) URL the app connects to (shown next to the QR)."""
|
||||
scheme = "https" if secure else "http"
|
||||
return f"{scheme}://{host}:{int(port)}"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user