Skip to content

Commit 5167bac

Browse files
committed
Ignore appstate changes in websocket from back to front
1 parent 1f15e64 commit 5167bac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/routers/ws_router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ async def consume_redis_stream(redis_client: aioredis.Redis, stream_key: str,
229229
# Create WebSocketMessage and send to client (if not from this connection)
230230
message_to_send = WebSocketMessage(**redis_dict)
231231

232-
if message_to_send.connection_id != connection_id and websocket.client_state.CONNECTED:
232+
if message_to_send.connection_id != connection_id and websocket.client_state.CONNECTED and message_to_send.type != 'appstate_update':
233233
await websocket.send_text(message_to_send.model_dump_json())
234234
except Exception as e:
235235
print(f"Error sending message from Redis: {e}")

0 commit comments

Comments
 (0)