Skip to content

Commit fa8b8f5

Browse files
committed
Fix event feed last event ID lookup.
This has been added in ef8c832 The first `eventid` will be 1. If the event feed reading client does not pass in a `since_token` or `since_id`, we set `since_id` to `-1` to signal start reading from the beginning. In that case there is no previous event that can be expected to exist.
1 parent f74e227 commit fa8b8f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webapp/src/Controller/API/ContestController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,8 @@ public function getEventFeedAction(
655655
$response->headers->set('Content-Type', 'application/x-ndjson');
656656
$response->setCallback(function () use ($format, $cid, $contest, $request, $since_id, $types, $strict, $stream, $metadataFactory, $kernel) {
657657
$lastUpdate = 0;
658-
$lastIdSent = max(0, $since_id); // Don't try to look for event_id=0
659-
$lastIdExists = $since_id === -1;
658+
$lastIdSent = max(0, $since_id);
659+
$lastIdExists = $since_id !== -1; // Don't try to look for event_id=0
660660
$typeFilter = false;
661661
if ($types) {
662662
$typeFilter = explode(',', $types);

0 commit comments

Comments
 (0)