mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Fix duplicate events in live logbook (#113828)
This commit is contained in:
parent
15c0422837
commit
32c64855b2
@ -423,7 +423,10 @@ async def ws_event_stream(
|
||||
hass,
|
||||
connection,
|
||||
msg_id,
|
||||
last_event_time or start_time,
|
||||
# Add one microsecond so we are outside the window of
|
||||
# the last event we got from the database since otherwise
|
||||
# we could fetch the same event twice
|
||||
(last_event_time or start_time) + timedelta(microseconds=1),
|
||||
subscriptions_setup_complete_time,
|
||||
messages.event_message,
|
||||
event_processor,
|
||||
|
@ -2285,7 +2285,7 @@ async def test_live_stream_with_one_second_commit_interval(
|
||||
|
||||
hass.bus.async_fire("mock_event", {"device_id": device.id, "message": "7"})
|
||||
|
||||
while len(recieved_rows) != 7:
|
||||
while len(recieved_rows) < 7:
|
||||
msg = await asyncio.wait_for(websocket_client.receive_json(), 2.5)
|
||||
assert msg["id"] == 7
|
||||
assert msg["type"] == "event"
|
||||
|
Loading…
x
Reference in New Issue
Block a user