File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,6 +163,22 @@ async def test_replay_skips_priming_events(store):
163163 assert events [0 ].event_id == id3
164164
165165
166+ @pytest .mark .anyio
167+ async def test_replay_skips_expired_event_payloads (store , redis_client ):
168+ anchor = await store .store_event ("stream-A" , SAMPLE_MSG )
169+ id2 = await store .store_event ("stream-A" , SAMPLE_MSG )
170+ id3 = await store .store_event ("stream-A" , SAMPLE_MSG )
171+
172+ # Manually delete the event key for id2 from Redis, but keep it in the sorted set
173+ await redis_client .delete (f"test:event:{ id2 } " )
174+
175+ events , _ = await collect_events (store , anchor )
176+
177+ # Replay should skip id2 (since its payload was deleted/expired) and return only id3
178+ assert len (events ) == 1
179+ assert events [0 ].event_id == id3
180+
181+
166182@pytest .mark .anyio
167183async def test_replay_events_are_in_ascending_order (store ):
168184 anchor = await store .store_event ("stream-A" , SAMPLE_MSG )
You can’t perform that action at this time.
0 commit comments