Thanks for the work to get subscriptions working on postgres but I'm having a lot of trouble understanding how the subscription interval stuff works.
I have been running tests on one of my sites which has yet to go live and it seems once i have a subscription interval set theres no consistent way of changing it.
I've tried un-subscribing and re-subscribing to a thread but it still posted it within the hour when the interval for that user was set to an hour (it had previously been as soon as possible)
I have had the time change sometimes but cannot replicate it.
Also I've had a look at the various subscription tables within the database and see the following things
subscriptions table : send_interval 0
subscriptions_user table : send_interval 3600 (for my userID which is what I have set for that user)
subscriptions_queue: send_interval 0 (for a new comment to a thread I've subscribed to)
It may just be that i haven't understood how this works, but if I haven't then how am I able to explain it to my users when they change the interval.
I'll happily provide accounts to my test sites if you need to see this in action.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | send_interval.pdf | 64.48 KB | bfo |
Comments
Comment #1
gustav commentedI think the reason for your confusion is that you missed the sentence "Any changes you make here will only apply to newly created subscriptions." at the bottom of the preferences field set. Perhaps it would help if the field set was called " Defaults" rather than " Preferences"? Would that be clearer?
Comment #2
bfo commentedso once a subscription has been set it can never be changed even by unsubscribing and resubscribing to a thread?
also if you drop the time from 1 hour to as soon as possible it doesn't stay at the 1 hour send interval it dropped to as soon as possible.
If this is actibg how it's supposed to can I request a feature request so that the interval can be changed somehow.
also do you know where in the tables this is set? as I can't find it.
If this cannot happen then theres no point letting users set the rate as it will just confuse them.
Comment #3
salvisThe one in {subscriptions_user} is the user's default, which is applied towards newly created subscriptions (unless it's -1, in which case the site default is used, which is the one with uid=-2).
The one in {subscriptions} is the value assigned to that one subscription. It should certainly change when you change it. There should be no need to delete and reenter a subscription for that. However, a changed interval will only apply to newly queued notifications, i.e. notifications queued with a delay of a day won't get delivered any sooner just because you change the interval. — You did make the Send Interval control visible for testing this, didn't you?
The one in {subscriptions_queue} determines when that queue item will be notified.
The exact algorithm is as follows: Whenever a notification is sent to a user, that user's {subscriptions.user}.last_sent is set to the current time (everything in seconds). Any notifications queued for that user will get a copy of {subscriptions.user}.last_sent as well as a copy of {subscriptions}.send_interval, both at the time when the notification is queued. The notification is not sent until {subscriptions_queue}.last_sent + {subscriptions_queue}.send_interval has passed.
At least that's the theory. Please see also http://drupal.org/node/204874
Is 'Defaults' better (clearer) than 'Preferences'?
Comment #4
bfo commentedThanks,
I'll do some more tests and see if that is actually happening as I don't think it is.
I'll also get someone else to test it in case I'm just being dumb.
If it's not doing what it's supposed to I'll gather evidence of what it is actually doing.
Comment #5
bfo commentedOk this didn't work.
I have attached a pdf of exactly what i did and what the tables were up to etc.
Happy to test more or give others access to test.
I read the docs and I understand why it did what it did, however do you know why it set the send_interval for the comment to 0 when I hadn't changed it from Hourly.
Comment #6
bfo commentedalso the email i got was this
| Greetings, admin.
|
| Your subscriptions on 1st South Battersea Senior Section
| notify you of the following changes since the previous digest:
|
Test of the Subscriptions module
This is a thread for testing subscriptions
| Link: http://www.1stsouthbattersea.org.uk/node/26
| Direct unsubscribe link (thread):
|
http://www.1stsouthbattersea.org.uk/s/del/node/nid/26/-1/1/1f4392b5d9943...
37b8ef7511f
SUBSCRIPTIONS_DEFAULT_DIGEST_ITEM_COMMENT|
--------------------------------------------------------------------
| This is an automated message. Please do NOT reply to the sender address!
| To manage your subscriptions go to
| http://www.1stsouthbattersea.org.uk/user/1/subscriptions
Comment #7
salvisThank you for the reports. The odd thing is that the send_interval for sid=4 at the bottom of the first page is 0, even though uid=1's send_interval is 3600. Furthermore, sqid=7 shows up with send_interval=3600, which is again wrong. sqid=8 is correct, based on sid=4...
I can't reproduce this on my end, so yes, now it might be useful for me to be able to try this on your end. Please send me log in details through my contact page. Can you also install the DBA module for me and give me the required permission? That would let me look at your tables. [Be aware though, that giving me access to DBA would allow me to take over your server!]
I'll look at the SUBSCRIPTIONS_DEFAULT_DIGEST_ITEM_COMMENT issue later today.
Comment #8
bfo commentedI don't think my other half would be too happy with the DBA module being installed on his server however I'll talk to him and see if there is a way we can give you some access.
I'll send you login details now.
Comment #9
salvisThat's fine, we'll see how far we can get without DBA.
I can't reproduce the behavior you described, not even on your site. Here's what I did:
This does not correspond to the results that you posted in #5. Where do our approaches differ?
Comment #10
bfo commentedyou should now have an email giving you DB access.
When I did the test I didn't change the Send Interval it was the same send interval at the start of the test till the end.
Hopefully now you have DB access we can work out whats happening.
Feel free to create new threads etc.
Comment #11
salvisIt's a pain to have to deal with two issues in the same thread — can you post #6 in a new thread, please?
Comment #12
salvisYes, but that doesn't matter. You started with a user preference of {subscriptions_user}.send_interval = 3600 — my 1. is pre-test setup to get to your "Pre testing table status."
And my 3. serves only to be able to distinguish in the GUI whether I'm seeing "3 hours" by default or from {subscriptions}.send_interval.
Comment #13
bfo commented#6 was supposed to be just for reference didn't mean it as a separate issue sorry.
Comment #14
salvisBut it is a separate issue. You're showing
SUBSCRIPTIONS_DEFAULT_DIGEST_ITEM_COMMENT
instead of the filled in template, and I confirmed this on your site...
Comment #15
bfo commentedah I didn't notice, I'll go put another issue in then.
Comment #16
salvisLast time we talked you said you were going to reinstall. Are you still seeing that odd Send Interval behavior?
Comment #17
bfo commentedSorry been a bit busy, i'm going to put this on my real test site I'll give you access to it.
Hopefully get enough time this weekend
Comment #18
salvisComment #19
chsiung commentedJust wanted to note that when I installed 2.1, the send intervals work correctly (whereas with the previous 2.0 rc 1, the digests weren't sent correctly).
Cheers,
Chris
Comment #20
salvisThanks.
Please don't play with the controls. Assign issues to yourself only to show that you intend to work on a patch for the issue.