domjudge
domjudge copied to clipboard
Add symfony command to recreate the event feed from existing data
Description of the enhancement request
Add a symfony command to recreate the eventfeed. The command is preferred over a button as this process can take a while.
The goal you want to achieve
Sometimes we fail in creating certain events (timeouts, errors etc.) or we have a very outdated eventfeed (demoweb). It would be beneficial if we can recreate the eventfeed and make sure that everything which has happened also did get the event.
This should be as 'easy' as:
- Dropping all events.
- Calling EventLogService::initStaticEvents`.
- Making sure we call
addMissingStateEventsat the correct times to insert the state events. - Looping over submissions, judgements, runs and clarifications and insert all these events.
But the state events are a bit interesting: since static events should not really matter and can come before any other event, we can first create all of these and then while looping over the other events, make sure to add the state event at the correct time.
We need to drop all existing connections as well, right? Or at least add some form of synchronization mechanism...
We need to drop all existing connections as well, right? Or at least add some form of synchronization mechanism...
Yeah and have new event ID's, as in if a client users since=<token> with a token we don't know about, we should return a 400.
So we need some way of putting down somewhere when the feed was last reset. We could mis-use the config table for that or something else.