Notification sent to all users after upgrade

Created on 30 April 2025, 18 days ago

Problem/Motivation

I upgraded from 4.0.0-rc2 (which worked fine). On the cron run last night it looks like ALL users have been sent a notification.

Steps to reproduce

Install 4.0.0-rc2
Set "Purge users who have not logged in for" to 24 months
Set "Notification User Before Deletion" to 23 months
Upgrade from 4.0.0-rc2 to 3.0
Run cron
Observe that you have just spammed thousands of people saying "you've not logged in for 2 years" and the date of the last login, which is clearly within the last two years,

Proposed resolution

Revert whatever you did in releasing 4.0.0 which now ignores these rules.
Maybe this is related to Issue 3517192 ?

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇬🇧United Kingdom matt b

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @matt b
  • 🇫🇷France mably

    What is strange is that all the unit tests that validate that rule are still green 🤔

    @saidatom could you have a look at it?

  • 🇫🇷France mably

    FYI "Notification User Before Deletion = 23 months" means that users will be notified up to 23 months in advance.

    So that might explain the behavior you observe.

    @saidatom can you confirm?

  • 🇫🇷France mably

    Added a warning message on the module message about that BC breaking change with 4.x version.

  • 🇬🇧United Kingdom matt b

    FYI "Notification User Before Deletion = 23 months" means that users will be notified up to 23 months in advance.

    This was not the case until 26th April! If you fundamentally change the rules like this you need to communicate it clearly.

    There's no description below 'Value' on the form either, so we're left guessing - not great UX.

  • 🇫🇷France mably

    We are very sorry for this last minute change, but it seemed important before we released that new major version.

    I'll see what I can do to improve the field labelling. Feel free to share any idea you could have about that.

  • 🇫🇷France mably

    @matt-b does it feel better presented like this?

  • 🇬🇧United Kingdom matt b

    Re-opening this. I changed the notification value to 1 month and emails are still going out!

    Please revert the change made to rc2.

  • 🇫🇷France mably

    Could you provide a repeatable test scenario from a fresh Drupal 11 install?

    If there is a bug, we will fix it as soon as possible.

  • 🇬🇧United Kingdom matt b

    Could you provide a repeatable test scenario from a fresh Drupal 11 install?

    Sorry, no. I have a very demanding day job and run 1 drupal site in my spare time for a charity. We're on Drupal 10, I don't have the capacity to investigate this further. For now I'll be updating my composer.json to use the rc2 as it worked fine.

  • 🇬🇧United Kingdom matt b

    as it is spamming thousands of users I believe notfications are batched to cron. In my devtest this only runs while the environments are active which is why I may still be seeing notifications (re-directed to a test inbox) after changing the parameters. Is there a way to 'unbatch' these?

    Reverting to 4.0-rc2 and manually purged gave only 2 notifications (correctly). Once the batch has cleared I'll look at 4.0 again.

  • 🇫🇷France mably

    You should be able to clear the notification_users queue using the queue_ui module I guess...

Production build 0.71.5 2024