Skip to content

Commit 5d05bca

Browse files
committed
seq_num 0
1 parent 8a0de86 commit 5d05bca

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/test_websocket_timing.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ async def test_subscribe_after_first_update(http_client):
9999

100100
@pytest.mark.asyncio
101101
async def test_subscribe_after_first_update_from_beginning(http_client):
102-
"""Client that subscribes after first update but requests from seq_num=1 sees all updates."""
102+
"""Client that subscribes after first update but requests from seq_num=0 sees all updates.
103+
104+
Note: seq_num starts at 1 for the first data point. seq_num=0 means "start as far back
105+
as you have" (similar to Bluesky social)
106+
"""
103107
# Create node
104108
response = await http_client.post("/upload")
105109
assert response.status_code == 200
@@ -117,7 +121,7 @@ async def test_subscribe_after_first_update_from_beginning(http_client):
117121
await asyncio.sleep(0.1)
118122

119123
# Connect WebSocket requesting from beginning
120-
async with aconnect_ws(f"/stream/single/{node_id}?seq_num=1", http_client) as ws:
124+
async with aconnect_ws(f"/stream/single/{node_id}?seq_num=0", http_client) as ws:
121125
# First, should receive the historical update
122126
historical_msg = json.loads(
123127
await asyncio.wait_for(ws.receive_text(), timeout=2.0)

0 commit comments

Comments
 (0)