Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event feed API endpoint may return duplicate entries #837

Open
johnbrvc opened this issue Nov 1, 2023 · 0 comments
Open

Event feed API endpoint may return duplicate entries #837

johnbrvc opened this issue Nov 1, 2023 · 0 comments
Assignees
Labels
bug Something isn't working high priority Bugs that are high priority (to fix) Primary CCS Required for PC2 to act as primary CCS
Milestone

Comments

@johnbrvc
Copy link
Collaborator

johnbrvc commented Nov 1, 2023

Describe the issue:
When requesting the event feed using the contest/event-feed API endpoint, duplicate events may be sent in the returned stream.

To Reproduce:
To duplicate this issue, there are several prerequisites (we will use the "submissions" data records for this example):

  1. Using a completed contest, or one in which there are already many submissions
  2. Multiple (more than 1) consumers of the event feed had to be active (connected) when submissions were made.

Assuming both 1 and 2 are satisfied, a new connection on the event-feed endpoint will see every submission that was made duplicated N times where N = NC-1, where NC = number of event-feed consumers that were connected when the submissions were made.

Expected behavior:
Events should not be duplicated on the event-feed when a new consumer connects.

Actual behavior:
Duplicate events may be returned when a new consumer requests the event-feed API endpoint.

Environment:
All.

Log Info:

Screenshots:
N/A

Additional context:
Basically, for every client consuming the event feed, an entry is added to the EventfeedLog_Default--XXXXXXXXXX.log file for each event that is generated while said consumers are connected. This causes multiple copies of the same event to be put into the saved event feed log file: EventfeedLog_Default--XXXXXXXXXX.log When a new event-feed consumer connects, PC2 reads the EventfeedLog_Default--XXXXXXXXXX.log file and sends that to the new consumer. The file contains the duplicate entries. (See attached file). It seems, in EventFeedSTreamer.sendJSON(), the eventFeedLog.writeEvent(string) is called for each instance of the streamer.
sendJSON() is called (for each RunListener, and there is a RunLIstener for each connected consumer).

To obtain a correct event feed, use the report generator from an Admin or the Server GUI. The Event Feed client's View Event Feed button uses the EventFeedLog, and, as a result, will have duplicate entries as described above, whereas the report generator completely regenerates the event feed based on internal data structures.

EventfeedLog_Default-Excerpt.log

@johnbrvc johnbrvc added bug Something isn't working high priority Bugs that are high priority (to fix) Primary CCS Required for PC2 to act as primary CCS labels Nov 1, 2023
@johnbrvc johnbrvc self-assigned this Nov 2, 2023
@troy2914 troy2914 added this to the 9.11.0 milestone Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority Bugs that are high priority (to fix) Primary CCS Required for PC2 to act as primary CCS
Projects
None yet
Development

No branches or pull requests

2 participants