If an organizer adds a tracking tool to an event (or removes it), but the synchronization fails, we won't add (or remove) the tool. Changes to the event will still be saved, but the organizer should see a warning message in the interface stating that the tool in question could not be added/removed.
Acceptance criteria
Assuming that an organizer edits (or creates) an event and adds a tracking tool that passes validation but not the actual commit logic (*), then:
- When using the API (enable event registration and update event registration), the response should be successful but it should contain a warning message.
- When using the special page (Special:EnableEventRegistration and Special:EditEventRegistration), saving should succeed but there should be a warning box below the success box.
- When using either the API or the special page, the failed update should be logged in the "CampaignEvents" channel (check the MW log file, see https://www.mediawiki.org/wiki/Manual:How_to_debug#Logging).
(*) - You probably have to manually change the code to see this behaviour, as it's not supposed to happen during normal operations. The easiest way is to edit WikiEduDashboard::validateToolAddition and ::validateToolRemoval and change their content to:
return StatusValue::newGood();
and also edit WikiEduDashboard::addToNewEvent, ::addToExistingEvent, and ::removeFromEvent and change their content to:
return StatusValue::newFatal( 'campaignevents-tracking-tool-http-error' );