Hi Gisle.

I've configured Notify to send notifications every 3 days at 01:00 (by night).
If I add new content after 1 or 2 days from previous notification, it waits until 01:00 of 3rd day, so it works.
But if I add content after 3rd day, it send notifications at next cron run (every hour), doesn't matter what time is it.

Thanks,

Josean.

CommentFileSizeAuthor
#22 ScreenShot174.jpg76.86 KBjosean
#22 ScreenShot175.jpg47.38 KBjosean

Comments

gisle’s picture

Status: Active » Postponed (maintainer needs more info)

I am unable to reproduce this.

I've set up my copy of Notify to send out notifications every three days, with sending hour set to 01:00 (i.e. I've tried to reproduce your setup). I added content at 22:00 on the third day, just 3 hours before the next batch is supposed to be sent. I then run cron. No notifications are sent.

I need more details about how to reproduce this error to track it down.

josean’s picture

Hi gisle.

To reproduce the bug, just try to add some content AFTER batch was supposed to sent but wasn't because there was no new contents (for example at 9:00 in forth day) and run cron. It will send you notifications inmediately.
In this case, I expect not to receive until 01:00 of fifth day.

I hope to have explained correctly.

josean’s picture

Hi gisle.

I was thinking maybe we have a diferent concept for this question. Let me explain.

In config/people/notify/queue, displayed message is
"STATUS
There are 0 nodes and 0 comments created since 26 Feb 2014 - 01:15.
No unpublished items.
No notifications queued.
Last batch: sent 187 e-mails, no failures.
The next notification is scheduled for the first cron run after 1 Mar 2014 - 01:00."

In config/people/notify:
"Send notifications every
3 days
Hour to send notifications
1"

Cron runs hourly at minute 15.

So consider my first content added after 26-feb is in 1-mar 08:30.
In this case, next cron run after 1-mar 1:00 was at 1:15 but there was no content.
When should be notified content of 1-mar 8:30?
I consider it should be sended in 2-mar 01:15.
notify alpha5 will send it at 1-mar 9:15.

Many thanks.

josean’s picture

Version: 7.x-1.0-alpha3 » 7.x-1.0-alpha5
gisle’s picture

Assigned: Unassigned » gisle
Status: Postponed (maintainer needs more info) » Active

OK, I think I understand what you mean now.

gisle’s picture

Status: Active » Needs review

In the 7.x-1.0-alpha6 release: https://drupal.org/node/2218437 the logic is changed for sending notifications when the time since last notification exceeds the frequency set.

Previously, these notifications were always sent on the first possible cron run, no matter what frequency were set.

In 7.x-1.0-alpha6, the logic depends on the frequency set:

  • If the frequency is one day or greater, it will send pending notifications on the first cron run after the set sending hour (i.e. it will try to respect the hour set for sending out notificatons).
  • If the frequency is less than one day it will send pending notifications on the first possible cron run (i.e. the same behaviour as before).

Please review.

gisle’s picture

Version: 7.x-1.0-alpha5 » 7.x-1.0-alpha6

Updated to the release were this is fixed.

josean’s picture

Thanks Gisle.

I have just installed alpha6. In some days I will tell you if it works as expected.

Regards.

gisle’s picture

Status: Needs review » Needs work

Unfortunately, the first attempt to "fix" this (i.e. alpha6) introduced a new bug. In some cases, queued notifications are not sent at all. This is unfortunately a more serious problem than sending hour is not respected in certain cases.

As a temporary fix, download and install latest dev snapshot (commit 7ecd69b, dated April 5, 2014 7:30), or set the interval to be 12 hours or shorter.

  • Commit 7ecd69b on 7.x-1.x by gisle:
    #2182323 by gisle: Rollback to fix more serious bug introduced in alpha6...
josean’s picture

Hi Gisle.

I agree with you. With alpha6, notify always waits for next day and never sends.
Provisionally I activate 12 hour frequency.

Thanks,

Josean.

  • Commit 221f457 on 7.x-1.x by gisle:
    #2182323 by gisle: Work on the sending hour not respected ussue,
    

  • Commit 778f939 on 7.x-1.x by gisle:
    #2182323 by gisle: Work on the sending hour not respected issue
    

  • Commit 03215e9 on 7.x-1.x by gisle:
    #2182323 by gisle: I hope this release fixes the sending hour not...
gisle’s picture

Version: 7.x-1.0-alpha6 » 7.x-1.0-alpha7
Status: Needs work » Needs review

I've just pushed version 7.x-1.0-alpha7 of Notify to the repo: https://drupal.org/node/2246671.

I hope this release fixes this bug.

Please review.

  • Commit d9a605b on 7.x-1.x by gisle:
    #2182323 by gisle: Fixed bug extracting the batchsize.
    
gisle’s picture

Version: 7.x-1.0-alpha7 » 7.x-1.0-alpha8

Updated to relevant version.

josean’s picture

Hi Gisle.

I've tested and it works like expected. Good job!!

With this issue corrected, I think you could push Notify to a beta or working version.

Many thanks,

Josean.

gisle’s picture

Status: Needs review » Fixed

Updated status.

josean’s picture

Status: Fixed » Needs review

I'm sorry Gisle, but yesterday it DIDN'T work as expected.

Notify was configured for each 2 days, at 01:00.
New content was published at 18:25
Notify sended emails this day at 20:15
I've updated from admin/reports/updates/update.
Do I have something wrong?

Thanks!

gisle’s picture

I am not able to reproduce this, and need more information.

After you publish content, can you look under the queue tab in the Notify admin interface and make a note of what the date and time that is the end of this line:

The next notification is scheduled for the first cron run after ...

Notify shall not send out any notifications before this. Can you check whether it does, or whether this date and time is not what it is supposed to be?

josean’s picture

StatusFileSize
new47.38 KB
new76.86 KB

I think the message was correct and was:
"The next notification is scheduled for the first cron run after 26 Apr 2014 - 01:00"
But sended at 25 Apr - 20:15.

Now I'm looking and I can see:
"There are 7 nodes and 0 comments created since 27 Apr 2014 - 01:15.
No unpublished items.
Notifications about at least 7 items are queued.
Last batch: sent 191 e-mails, no failures.
The next notification is scheduled for the first cron run after 28 Apr 2014 - 01:00."

For the moment (27 Apr - 22:40) it is waiting for 28 Apr. Tomorrow I will tell you.

Just a 2nd question.
Now its configured for sending each 2 days at 01:00, so correct schedule day should be 29 Apr - 01:00
I give you 2 screenshots

Regards,

Josean.

gisle’s picture

Now its configured for sending each 2 days at 01:00, so correct schedule day should be 29 Apr - 01:00.

That is corrrect.

The sentence:

There are 7 nodes and 0 comments created since 27 Apr 2014 - 01:15.

means that the last notification sent were started at that time (sending may have ended some time later, because Notify may spend some time sending if there are a lot of emails to be sent).

To compute the next time to send, in your case, two days shold be added to that (taking us to 29 Apr - 01:15), and then adjusted to the correct "sending hour" ("01:00"). So the value that should have been displayed is "29 Apr 2014 - 01:00".

I'll look into this as well.

josean’s picture

Hi Gisle.

I give you my conclusions in both issues, after yesterday's test.

Issue 1) Planned hour.
Today, 28-apr, notify has sended at 01:15.
This is perfect because cron is activated every hour at minute 15, so "first cron run" after 01:00 is 01:15.
So this time notify respected his planned hour.
Also, I understand your comment about "started" time. My 191 emails are sended in 2 groups, first one at 01:15 and next one at 02:15 (next cron).

To be honest, I have to tell you (I've looked for answers in system log) that in 25-Apr I logged in at 19:47 and logged out at 19:49. Messages were sended at 20:15 (instead of expected next day 01:00), so maybe I changed frequency to "hourly" and after messages were sent, to daily. Strange madness but probably this is my fault.
So please, don't waist time with this. I will make more tests and I will tell you. I really sorry for that.

Issue 2) Planned day.
Doesn't matter the configured number of days. If frequency is set to 1 or more days, notify always assumes 1 day.
I have tried different options in "settings" windows (1 day, 2 days, 3 days, 1 week, 2 weeks, 4 weeks), saving each time and "queue" window always says:
"There are 0 nodes and 0 comments created since 28 Apr 2014 - 01:15.
The next notification is scheduled for the first cron run after 29 Apr 2014 - 01:00."

Thanks and sorry again for inconveniences.

Josean

  • Commit 4e10121 on 7.x-1.x by gisle:
    #2182323 by gisle: Sending hour is not respected in certain cases - made...
gisle’s picture

Version: 7.x-1.0-alpha8 » 7.x-1.0-alpha9

I found some variables that may not have been initialised correctly and cause erratic behaviour. These have now been fixed and the corrected code has been released as Notify version 7.x-1.0-alpha9. Release notes: https://drupal.org/node/2253991.

I hope this release fixes this bug, and that Notify can progress to RC status.

Please review.

gisle’s picture

Status: Needs review » Fixed

Looks as if this one is fixed in 7.x-1.0-alpha9.

Feel free to reopen if this does not match your experience.

josean’s picture

Hi Gisle.

After about 2 weeks of tests, I think this issue is corrected.
Many thanks for your work.

Regards,

Josean.

gisle’s picture

Version: 7.x-1.0-alpha9 » 7.x-1.0-rc2

Setting to correct version.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.