Index not properly updated during save event after changing a deviation
I have a daily recurring event with one deviation: start and end time are one hour later than the original event on one single day. The record has been initially saved, index has been built correctly.
Then later, in TYPO3-Backend, I make a change to the start time of this deviation (let's say: I add +5 minutes). Then I save the record. The index in tx_cal_index will be rewritten for this event-uid, but for my deviation the OLD time gets stored again, not reflecting the +5 minutes change.
When I then save the record again in the backend, the index gets rewritten once again, and now the start time for my deviation in correctly saved in tx_cal_index.
After a bit of debugging, I am quite sure that your call...
generateIndexForUid > $eventService->recurringEvent > findDailyWithin > $deviationDates = $event->getDeviationDates ()
still returns the old deviation dates/times, because the changes to the deviation have not yet been stored to tx_cal_event_deviation by the TYPO3-Core at this moment. This explains why the second saving process finally works.