On Motospace we're using a modified version of your events plugin. So we discovered a problem with invitations that time out (i.e. get deleted) pretty fast. I decided to look up the problem and compared the code to the events plugin. But guess what? It's still exactly the same. :) So here we go:
The cron job has to run every minute. That's what the documentation says. As far as I understood, in that process the cron.php of every plugin gets started as well. So I looked at that and found
$this->addJob('clearInvitations', 20);
The 20 is the interval... I'm not sure what that exactly means, but every 20 runs this one get's executed, too? Something like that? Well anyway... as it get's called it starts
EVENT_BOL_EventService::getInstance()->findCronExpiredEvents(0, 1500);
which later is used to fire up the "clearEventInvitations" function based on the list it got back. So I check what that does... it calls another function but to make a long story short, it boils down to an SQL query which is the following:
$query = " SELECT DISTINCT `e`.* FROM `" . $this->getTableName() . "` as `e` "
. " INNER JOIN `" . EVENT_BOL_EventInviteDao::getInstance()->getTableName() . "` as `ei` ON ( `ei`.eventId = e.id ) "
. " WHERE 1 ORDER BY `e`.`startTimeStamp` DESC LIMIT :first, :count";
So... "WHERE 1". Wait, what? EVERY invitation is in that list? So every single time "clearInvitations" is actually executed, it deletes ALL invitations? That can't be right, can it? And that would explain why some or even all invitations get deleted before anyone would have a chance to accept it.
So what's wrong here? Did I misunderstand the code? If so, why and when are invitations deleted? Wouldn't it be nice if they got deleted... well, after the event already started or something? Seems not to be the case, actually.
But maybe it's some misconfiguration on our side. Maybe the modified plugin does not behave as expected, but as far as I can see, it does exactly the same thing as the original event plugin. After all it's not modified that heavily. Actually it's almost not modified at all.
So can you explain or maybe even fix that in the event plugin please? Some options would be nice on this one,too. To change when those invitations actually get deleted.