PeterJCLaw / srcomp-screens

Contains the web pages for the various screens that are displayed at the competition.
https://github.com/PeterJCLaw/srcomp/wiki/Component-Overview#srcomp-screens
MIT License
0 stars 1 forks source link

Outside screens don't forget teams which are no longer in the system #5

Closed PeterJCLaw closed 1 year ago

PeterJCLaw commented 5 years ago

If you accidentally deploy a compstate from a previous year, then the screens will pick up on that and when they update they'll get a bunch of extra data. When you fix that, the wrong teams should drop out of the system, but for some reason they don't. This causes confusion to teams.

PeterJCLaw commented 5 years ago

I think this is a consequence of the way that the stream works -- when it detects a change, it emits events containing (only) the new information. Additionally, each element within a collection is emitted as a separate event.

Therefore there isn't really a way for the screens to know that a team has been removed. We perhaps could do something like detect that a set of updates has started and then clear out our list of teams, expecting that the stream will refill it, however this seems likely to cause its own issues.

A better solution here is to have the stream emit events that inform clients about the removal of a team which the stream had previously informed them about.

Alternatively, having the stream trigger the dropping of all information about teams might be a way to go. That should still be robust as the stream would know that it's going to send all new data out, which the clients cannot otherwise know. It also avoids the stream needing to keep track of the previous state it emitted events for, so is potentially simpler.

PeterJCLaw commented 1 year ago

Ah, my prior comment here isn't quite right -- the stream does handle the removal of a team. When that happens it emits an event with null data:

event: team
data: null
PeterJCLaw commented 1 year ago

Looking at this a bit more -- it turns out that this doesn't affect the arena screens since they don't rely on the stream for data, only for knowing that a change has happened. The outside screens rely on the data update in the stream event (which of course in the case of a team removal isn't usefully present), where the arena screens just clear their caches and refresh everything.