Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,14 @@ async def fetch_next_request(self) -> Request | None:
request_id = self._head_requests.pop()
if request_id not in self._requests_in_progress and request_id not in self._requests_already_handled:
self._requests_in_progress.add(request_id)
return await self._get_request_by_id(request_id)
request = await self._get_request_by_id(request_id)
if request is None:
# Defensive guard against an unexpected `None` from the platform: leaving the id in
# `_requests_in_progress` would make `is_empty()` never settle and filter the id out of future
# head reconciliations, with no recovery path for the caller.
self._requests_in_progress.discard(request_id)
continue
return request
# No request locally and the ones returned from the platform are already in progress.
return None

Expand Down
Loading