Your software
My Mautic version is: v3.2.3
My PHP version is: 7.4.13
My Database type and version is: MySQL 5.7
Your problem
My problem is:
After sending a segment email, I’m noticing a discrepancy between the “readCount” property on the email entity, which is shown in list, and the actual email stats (which email is sent to which contact and is known as read).
What I’m observing is that readCount is very often higher than number of entries in email_stats belonging to the affected email where “date_read” is not null (so the email is treated as “read” for a particular contact). This also expresses when clicking on “xx Read” colored badge, only contacts appear that have read the email - which is the expected count of reads of that email.
Sample:
These errors are showing in the log:
No errors
Steps I have tried to fix the problem:
I’ve traced down the tracking of reads of emails down to “hitEmail()” (mautic/EmailModel.php at 6cf4b343af87fa8fde29dc5a7695262d184a0a1d · mautic/mautic · GitHub) method. According to that method, “upCount()” is only executed when the email isn’t read yet, so only unique reads should be counted on “readCount”. So the “readCount” counter shouldn’t be higher than actually number of entries in email_stats where date_read is not null…
Additionally, I’ve been analysing my access logs and I can exactly reproduce the email opens that lead to email_stats entries set to “is_read” = 1 and “date_read” with the first open of the email.
Does anybody have an idea what could cause readCount being higher than actual reads recorded in email_stats?
Any help is much appreciated!
Thanks,
Simon