I have observed strange behavior in notifications associated with custom subscriptions. I have six custom subscriptions, one for each of six content types. Each one is configured to be automatically enabled for new users with a default interval of weekly.

The pattern I observe is that a new user's six custom subscriptions will be added to the notifications table and notifications get added to the notifications_queue table; however, some notifications are sent almost immediately or within the hour. (poorman's cron runs hourly.)

Is this so that the users-interval combination is added to the notifications_sent table as a marker for when the next weekly notification should occur?

I cannot otherwise explain these notifications.

Comments

jose reyero’s picture

Title: Custom Subscription sending notification immediately for new users » Notifications are sent immediately once for new subscriptions (whatever the interval)
Assigned: Unassigned » jose reyero

I guess I know what's going on.

The algorithm for checking which notifications should be sent next checks 'how long ago a notifications was sent for this interval(weekly) to this user' and if it was never sent it (wrongly) assumes it is more than a week ago.

So we need to fix the queue query to take into account when the subscription was created and do not send them if it was less than a week ago.

This is something to fix for all subscriptions, not only for custom ones.

jose reyero’s picture

Version: 6.x-2.x-dev » 6.x-4.0-beta5

We'll fix it first for 4.x, then backport if possible.