Skip to content

Commit

Permalink
Fix event feed last event ID lookup.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
meisterT committed Oct 22, 2024
1 parent f74e227 commit fa8b8f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/src/Controller/API/ContestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ public function getEventFeedAction(
$response->headers->set('Content-Type', 'application/x-ndjson');
$response->setCallback(function () use ($format, $cid, $contest, $request, $since_id, $types, $strict, $stream, $metadataFactory, $kernel) {
$lastUpdate = 0;
$lastIdSent = max(0, $since_id); // Don't try to look for event_id=0
$lastIdExists = $since_id === -1;
$lastIdSent = max(0, $since_id);
$lastIdExists = $since_id !== -1; // Don't try to look for event_id=0
$typeFilter = false;
if ($types) {
$typeFilter = explode(',', $types);
Expand Down

0 comments on commit fa8b8f5

Please sign in to comment.