feat(realtime): add ping/pong heartbeat and watchdog reconnect
Some checks failed
CI / test (push) Failing after 20s
Some checks failed
CI / test (push) Failing after 20s
- support ping incoming event and pong outgoing response - add web heartbeat interval to keep ws alive - add stale-connection watchdog to force reconnect on missing pong
This commit is contained in:
@@ -17,6 +17,7 @@ RealtimeEventName = Literal[
|
||||
"message_delivered",
|
||||
"user_online",
|
||||
"user_offline",
|
||||
"pong",
|
||||
"error",
|
||||
]
|
||||
|
||||
@@ -40,7 +41,7 @@ class MessageStatusPayload(BaseModel):
|
||||
|
||||
|
||||
class IncomingRealtimeEvent(BaseModel):
|
||||
event: Literal["send_message", "typing_start", "typing_stop", "message_read", "message_delivered"]
|
||||
event: Literal["send_message", "typing_start", "typing_stop", "message_read", "message_delivered", "ping"]
|
||||
payload: dict[str, Any]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user