domjudge icon indicating copy to clipboard operation
domjudge copied to clipboard

Add symfony command to recreate the event feed from existing data

Open vmcj opened this issue 1 year ago • 3 comments

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.

vmcj avatar Feb 13 '24 18:02 vmcj

This should be as 'easy' as:

  • Dropping all events.
  • Calling EventLogService::initStaticEvents`.
  • Making sure we call addMissingStateEvents at 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.

nickygerritsen avatar Feb 13 '24 19:02 nickygerritsen

We need to drop all existing connections as well, right? Or at least add some form of synchronization mechanism...

meisterT avatar Feb 18 '24 09:02 meisterT

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.

nickygerritsen avatar Feb 18 '24 10:02 nickygerritsen