solved Event Notification timing oddness

Strumelia
Strumelia
@strumelia
9 years ago
3,605 posts
In my Events Calendar module, I had the notification time set for 48 hours before the event start time -for members to be reminded via notification, if they were 'attending' the event. (but I have since set it to 0 to stop all notifications til I figure this issue out)
But my moderator just today received an emailed site notification saying the event she had marked that she would be attending was going to start "soon"....when in fact the event's date was set days ago when created, as not happening until November 2016....I saw it myself when it was created, and it has not changed.

Is this a glitch? Where can I check or see the setting/code for the 'attending member' notification timing for events?


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 06/20/16 11:28:42PM
michael
@michael
9 years ago
7,821 posts
cant see any way this could have happened. That's not to say that it couldn't happen, just I'm not seeing how it could happen.

The system:
* once an hour the system performs routine tasks. This is triggered by any person visiting the site more than an hour from the last time it was triggered.

* during that routine task a separate task fires that asks if any modules want to send out any emails to anybody.

* The events module uses that second routine to locate any users who have clicked the attending button for any event that has its event_date coming up within your set '48 hours' (or whatever) between the current hour and the event_date.

I can see that if the notification time was set to 1 hour, then its conceivable that if nobody visited that site within the 1 hour prior to the event time that the email might not get sent out, but 48 hours seams enough to ensure someone (or a bot) visited the site within that time and triggered the hourly routine off.

while looking I was trying to locate any setup that might cause the email to get sent AFTER the event and I cant see how it could happen.

The search looks for
 any events that are in the future AND are less in the future than now + 48 hours

any other clues? old modules, extra modules? not sure....
Strumelia
Strumelia
@strumelia
9 years ago
3,605 posts
Yes, I do have an 'extra module for Events, custom made i believe by Paul:

description: A listener module to create an event_end field from the entered event duration (event_duration field (number of days) needs creating with the Form Designer)
version: 1.0.0
developer: The Jamroom Network, ©2016
license: Click to View License
directory: jrXEventDuration


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Strumelia
Strumelia
@strumelia
9 years ago
3,605 posts
Thus- I have the usual Events Calendar module, and my custom Events Duration module, both active.

I should add that when some odd thing happens on my site, it seems to happen more often than normal to my Moderator (profile admin) Robin T...and she accesses the site almost always from her iPad Mini tablet. Not sure if that has any bearing.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
michael
@michael
9 years ago
7,821 posts
Think I've found the issue, its related to that extra module installed (jrXEventDuration).

What is happening is that module has a check in it for when searches are done for events which have an event_date on them AND the "show past events" option is set to not show past events.

Because your events have an end date ('event_end') it is re-writing the request from:

"get me all the events that are newer than today" to
"get me all the events that haven't ended today"

In a normal list, that's fine, but with the notifications emails the request is:
"get me all the events that are are newer than today, but no newer than (notification time setting in hours)" and its rewriting that to:
"get me all the events that haven't ended today"

Think I've got it fixed up. I've put the module in a private release channel since you're the only one using it.

I've sent an invite email.

put that invite code here:
http://fotmd.com/marketplace/release_channels

Then the jrXEventDuration module will appear in the marketplace updates, update it and set the time back to 48 hours and all should be well.

--edit--
to remove email address
updated by @michael: 03/22/16 03:55:20PM
Strumelia
Strumelia
@strumelia
9 years ago
3,605 posts
Oh boy, I'm SO impressed that you can wrap their brain around all that.
I have done the above and updated, and will ask my moderators to let me know the next time they get 'event coming soon' notifications. Meanwhile I'll mark this solved unless it misbehaves again. I set the notify time to 72 hours now (3 days).

I'm very grateful to you Michael- thank you for spending the time to figure this out. I know I could not have...well maybe a few years from now...maybe. ;)


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
michael
@michael
9 years ago
7,821 posts
Its not so impressive, its much easier to read in code, turning it into english it seams complicated.

The hard part is understanding what IS happening vs what you WANT to happen, then its just writing some rules.

You'd have it sorted pretty quickly if its something that interests you I'm sure.
Strumelia
Strumelia
@strumelia
9 years ago
3,605 posts
It does interest me! But I'm still in beginner level as to making code changes. The coding fascinates me and I've actually done a lot of minor site tweaking over the past several months ('mostly' successfully...lol), but my time and energies are just spread too thin over various projects, work, interests, and obligations.
In any case, I think the events firing is a rather convoluted concept when there are several factors all colliding with each other. Maybe I impress easy. ;) Thanks again!


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
michael
@michael
9 years ago
7,821 posts
:) cool, a bit at a time then.

so in code terms this was requested as the search parameters:
"event_date >= {$min}",
"event_date < {$max}"
and it was being changed by a listener:

Docs: "Events and Listeners"
https://www.jamroom.net/the-jamroom-network/documentation/development/1011/events-and-listeners

so that it read:
"event_end >= {$min}",
"event_end >= {$min}",

So the wrong things were coming back in the search results. {$min} is the time now. and > = means as you would expect 'greater or equal' which equates to "any events that have an end date in the future"

Just a FYI.
Strumelia
Strumelia
@strumelia
9 years ago
3,605 posts
Thanks Michael. :)


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015