Avatar

Question about the notification about inactivity for Micha (Technics)

by Auge ⌂, Monday, May 09, 2022, 21:15 (140 days ago)

Hello

With the version 20220508.1 we introduced the feature to send an e-mail to users who was inactive over a specified time (default is 3 years). Last night this forum sent many of these messages. Because of this I got 164 notifications about undeliverable e-mails. Checking the users list of this forum I saw many accounts with a lastest login on 2022-05-09 at 3:30 am. This is exactly the time of the last automatic daily actions (last night) minus three years.

I can not imagine this to be a coincidence.

@Micha: have you seen something similar in your forum? I expect this feature to be active in your installation for a longer time.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Not receiving password reset emails

by bers, Tuesday, May 10, 2022, 05:28 (139 days ago) @ Auge
edited by bers, Tuesday, May 10, 2022, 05:42

Related to this: I had a hard time remembering my password after receiving the notification (I finally did), but I tried the "reset password" functionality and have yet to receive an email. Since I received the expiry notification emails, I suspect it's not a general sending issue and not related to my email provider.

Edit: I should add that I did receive an email now, after having logged in, changed my password, and logged out and in again. So the issue, if it still persists, may be restricted to inactive accounts or amounts with a very old password. Either way, people with inactive accounts having forgot their password may have a hard time activating their accounts again.

Avatar

Not receiving password reset emails

by Micha ⌂, Tuesday, May 10, 2022, 06:29 (139 days ago) @ bers

Hello,

Edit: I should add that I did receive an email now, after having logged in, changed my password, and logged out and in again.

As far as I know, there is no need to change the password. You just have to log in, to reset the expiration date.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Not receiving password reset emails

by bers, Tuesday, May 10, 2022, 11:04 (139 days ago) @ Micha

Edit: I should add that I did receive an email now, after having logged in, changed my password, and logged out and in again.


As far as I know, there is no need to change the password. You just have to log in, to reset the expiration date.

That is well possible. What I am saying is that
- people who want to reset the expiration date need to log in
- people who want to log in need to know their password
- people who don't know their current password (which is likely after 3 years of inactivity) need to reset it
- the latter is not possible if you don't receive that email.

By the way, I did not receive any notification about your reply to my post despite having signed up for that.

TLDR: I believe email sending has problems in this forum instance.

Avatar

Not receiving password reset emails

by Micha ⌂, Tuesday, May 10, 2022, 13:48 (139 days ago) @ bers

Hello,

By the way, I did not receive any notification about your reply to my post despite having signed up for that.

I can confirm. I didn't get an email, too. @Auge, do you receive emails from the forum?

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Not receiving password reset emails

by bers, Wednesday, May 11, 2022, 04:39 (138 days ago) @ Micha

By the way, I did not receive any notification about your reply to my post despite having signed up for that.


I can confirm. I didn't get an email, too. @Auge, do you receive emails from the forum?

I received a reply notification for this message around 3:30 am, some 14 hours late. Is that intended? I also received two more inactivity notifications around 4:30 am (and another one just now), which must be incorrect because I am obviously active:) email reminder emails still don't arrive (at least not within minutes).

Avatar

Not receiving password reset emails

by Auge ⌂, Wednesday, May 11, 2022, 06:26 (138 days ago) @ bers

Hello

I received a reply notification for this message around 3:30 am, some 14 hours late. Is that intended? I also received two more inactivity notifications around 4:30 am

In which timezone do you live?

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Not receiving password reset emails

by bers, Wednesday, May 11, 2022, 07:36 (138 days ago) @ Auge

In which timezone do you live?

Berlin timezone.

Avatar

Not receiving password reset emails

by Micha ⌂, Wednesday, May 11, 2022, 07:28 (138 days ago) @ bers

Hello,

I received a reply notification for this message around 3:30 am, some 14 hours late. Is that intended?

I can confirm that the mail support is currently somewhat latent but works. However, all mails are sent, so this is not a crucial issue.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Not receiving password reset emails

by bers, Wednesday, May 11, 2022, 07:40 (138 days ago) @ Micha

I can confirm that the mail support is currently somewhat latent but works.

True - other reply notifications arriving with only ~2 hours delay.

However, all mails are sent, so this is not a crucial issue.

So you *are* receiving password reminder emails? I still am not.

Also, the extra inactivity emails. I'll let you know if there's another one tomorrow morning.

Avatar

Not receiving password reset emails

by Micha ⌂, Wednesday, May 11, 2022, 08:14 (138 days ago) @ bers

Hello,

So you *are* receiving password reminder emails? I still am not.

I got the "I forgot my password" - email, yes.

Also, the extra inactivity emails. I'll let you know if there's another one tomorrow morning.

Do you received a further mail? I wonder about this statement because we checked the last log on and flagged the user by setting `inactivity_notification` = TRUE.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Not receiving password reset emails

by bers, Friday, May 13, 2022, 08:45 (136 days ago) @ Micha

Sorry for the late reply - I again did not receive a reply notification email.

So you *are* receiving password reminder emails? I still am not.


I got the "I forgot my password" - email, yes.

Interesting, I still don't get a single one. If that matters, my email provider (for throwaway email, let's say) is GMX/Web.de, and there was a time of exactly one year where I did not receive email on any of their email addresses from followthatpage.com, leading me to hypothesize that they were blocking some stuff. Maybe that is happening here, too.

Do you received a further mail?

Not any more, now. Last one was >2 days ago. But how much can that be relied on when other email is not arriving, either? ;)

Not receiving password reset emails

by bers, Friday, May 13, 2022, 08:55 (136 days ago) @ bers
edited by bers, Friday, May 13, 2022, 09:09

Sorry for the late reply - I again did not receive a reply notification email.

So you *are* receiving password reminder emails? I still am not.


I got the "I forgot my password" - email, yes.


Interesting, I still don't get a single one.

Update: received the first one just now!

Edit: and a reply notification as well.

Avatar

Question about the notification about inactivity for Micha

by Micha ⌂, Tuesday, May 10, 2022, 06:28 (139 days ago) @ Auge

Hello,

@Micha: have you seen something similar in your forum? I expect this feature to be active in your installation for a longer time.

No. I have been running the forum with this feature for only a few years. Moreover, I use a no-reply-address.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Answering the question about the inactivity notification

by Auge ⌂, Thursday, May 12, 2022, 18:07 (137 days ago) @ Auge

Hello

With the version 20220508.1 we introduced the feature to send an e-mail to users who was inactive over a specified time (default is 3 years). Last night this forum sent many of these messages. … Checking the users list of this forum I saw many accounts with a lastest login on 2022-05-09 at 3:30 am. This is exactly the time of the last automatic daily actions (last night) minus three years.

I can not imagine this to be a coincidence.

The answer is the code in functions.inc.php, line 212 (current state of the master branch). The query stores the information about the sent inactivity notification and sets the columns last_login and last_logout to (NOW() - INTERVAL 3 YEAR) (3 is the default value, we used here).

Is there a reason to reset the columns last_login and last_logout I don't realise?

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Answering the question about the inactivity notification

by Micha ⌂, Thursday, May 12, 2022, 19:07 (137 days ago) @ Auge

Ho,

Is there a reason to reset the columns last_login and last_logout I don't realise?

Yes. The reason is, that these user will be delete in 30 days, i.e., (NOW - 3 YEAR - 30 days), cf. functions.inc.php#L183

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Answering the question about the inactivity notification

by Auge ⌂, Friday, May 13, 2022, 12:12 (136 days ago) @ Micha

Hello

Is there a reason to reset the columns last_login and last_logout I don't realise?


Yes. The reason is, that these user will be delete in 30 days, i.e., (NOW - 3 YEAR - 30 days), cf. functions.inc.php#L183

Ahh, yes. That sounds reasonable.

I realise, that my review at the time of the implementation was not really profound. In that case I would have at least proposed, to store the information about a carried out notification in another way. Now my proposal was to store this information as a timestamp in an otherwise empty (NULL) datetime-column. So we wouldn't need to manipulate a time information with a regulary different meaning. But that's, if at all, at the moment [s]not an urgent[/s] completely useless discussion. At the time of the pull request been open, it would have been appropriate.

Shit happens. 🤷

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Answering the question about the inactivity notification

by Micha ⌂, Friday, May 13, 2022, 12:29 (136 days ago) @ Auge

Hello,

yes. Maybe it is more readable using an extra value/column. However, this value has only a minor meaning. For that reason, I used the values that were available. However, afaik the code works correctly. But again: Improve it... ;-)

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Question about the notification about inactivity for Micha

by Auge ⌂, Thursday, May 12, 2022, 18:25 (137 days ago) @ Auge

Hello

I have a next question about the behaviour of the selection of inactive accounts.

The query to select the affected accounts (functions.inc.php, currently line 195) is this one:

 
SELECT
    `user_id`,
    `user_name`,
    `user_email`
FROM `mlf2_userdata`
WHERE `user_lock` = 0
    AND `user_type` = 0
    AND `inactivity_notification` = FALSE
    AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0
ORDER BY `last_login` ASC LIMIT 20;
 

Especially I am interested in AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0. I tested the query part in phpMyAdmin with these two versions. First one with a test_date, that is definitely older than 3 years and the second one with a test_date that is only two years ago.

SELECT '2017-12-30 12:45:40' AS test_date, (NOW() - INTERVAL 3 YEAR) AS old_date, ('2017-12-30 12:45:40' - (NOW() - INTERVAL 3 YEAR)) AS subtraktion
SELECT '2020-12-30 12:45:40' AS test_date, (NOW() - INTERVAL 3 YEAR) AS old_date, ('2020-12-30 12:45:40' - (NOW() - INTERVAL 3 YEAR)) AS subtraktion

These are the results.

2020-12-30 12:45:40  2019-05-12 20:12:31  -20190512199211
2017-12-30 12:45:40  2019-05-12 20:20:15  -20190512199998

In both cases I get a warning.

Warning: #1292 Falscher DOUBLE-Wert gekürzt: '2017-12-30 12:45:40'
/* free translation: shortened wrong DOUBLE value: */

I think, the logic of the condition is broken. The condition AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0 returns a negative value (< 0) (and is therefore TRUE) in every single case. But that's a task for tomorrow.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Question about the notification about inactivity for Micha

by Micha ⌂, Thursday, May 12, 2022, 19:28 (137 days ago) @ Auge

Hello,

In both cases I get a warning.

I think, it is a auto-cast problem. Please use the data base table instead of this query. Check out the true result using

SELECT
    `last_login`,
    (`last_login` - (NOW() - INTERVAL 3 YEAR))
FROM `mlf2_userdata`
WHERE `user_lock` = 0
    AND `user_type` = 0
    AND `inactivity_notification` = FALSE
ORDER BY `last_login` ASC;

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Question about the notification about inactivity for Micha

by Auge ⌂, Friday, May 13, 2022, 08:02 (136 days ago) @ Micha

Hello

In both cases I get a warning.


I think, it is a auto-cast problem.

Yes, you are right.

Please use the data base table instead of this query. Check out the true result using

SELECT
`last_login`,
(`last_login` - (NOW() - INTERVAL 3 YEAR))
FROM `mlf2_userdata`
WHERE `user_lock` = 0
AND `user_type` = 0
AND `inactivity_notification` = FALSE
ORDER BY `last_login` ASC;

I took the query, executed it with and without the user_type and with addition of the name and the (optional) addition of AND `last_login` > (NOW() - INTERVAL 3 YEAR). In every case I get the correct results.

*btw*: IMHO AND `last_login` > (NOW() - INTERVAL 3 YEAR) has a better readability than AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0 even both conditions work.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Question about the notification about inactivity for Micha

by Micha ⌂, Friday, May 13, 2022, 08:08 (136 days ago) @ Auge

Hello Auge,

*btw*: IMHO AND `last_login` > (NOW() - INTERVAL 3 YEAR) has a better readability than AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0 even both conditions work.

You are free to improve the code. Please change or replace it, to get more readable sources.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Question about the notification about inactivity for Micha

by Auge ⌂, Friday, May 13, 2022, 11:46 (136 days ago) @ Micha

Hello Micha

*btw*: IMHO AND `last_login` > (NOW() - INTERVAL 3 YEAR) has a better readability than AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0 even both conditions work.

You are free to improve the code. Please change or replace it, to get more readable sources.

I will take a look.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

RSS Feed of thread