-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: do not send daily digest email to user who is disabled #1803
fix: do not send daily digest email to user who is disabled #1803
Conversation
Activity Run #2059
Run Properties:
|
Project |
Activity
|
Branch Review |
fix/834/dont-sent-digest-email-to-disabled-user
|
Run status |
Passed #2059
|
Run duration | 02m 56s |
Commit |
8789e1bf33: fix: do not send daily digest email to user who is disabled
|
Committer | yemkareems |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
1
|
Pending |
0
|
Skipped |
0
|
Passing |
10
|
View all changes introduced in this branch ↗︎ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems enough 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to instead take an IUser object in sendDigestForUser and check the enabled state in parent method sendDigests ?
That would allow to also not update the activity.digest config value for disabled users, as that may be confusing. Would also be a bit better in performance to bail out earlier for disabled users.
I was wondering if we should even call $this->config->setUserValue($user->getUID(), 'activity', 'activity_digest_last_send', (string)$lastActivityId); so after re-enabling the user is not spamed with old legacy info from the day they got disabled. |
Hi @nickvergessen , @come-nc Do we need to do this for disabled user. I see there is a ACTIVITY_LIMIT and first time after re enabling user the notifications ll be cluttered and after that it should be fine. Please let me know and i ll do it accordingly |
Hi @come-nc , @nickvergessen I will add the user disabled check in sendDigests method as Côme suggested but will also add one updateLastSentForUser which will do |
Hi @come-nc, @nickvergessen I have done this change as requested but however i do not see a entry in oc_preferences for the disabled user(jane). I see the mail has gone out for admin user and only entry for admin user and not for the disabled user jane for whom i did some file rename just before disabling. Checking it locally now what is going wrong |
Could you push, so we can see what your code is? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good apart from 2 small changes.
… is not used Signed-off-by: yemkareems <yemkareems@gmail.com>
Signed-off-by: yemkareems <yemkareems@gmail.com>
/backport to stable28 |
/backport to stable29 |
/backport to stable30 |
/backport to stable28 |
/backport to stable29 |
1 similar comment
/backport to stable29 |
/backport to stable30 |
Add a extra check to not send the email to user who is disabled.
In my local i made jane a disabled user
And add the condition. This triggered a email to alice, bob and john. And it did not send the email to jane