Closed manandre closed 4 years ago
Hi @manandre,
You are right about this uniqueness provider !
What do you think if we update to uniqid function (with more_entropy parameter set to TRUE) ? It also rely on date (which is bad in our case) but more_entropy allow to add combined LCG number at the end. Thanks for your report !
Yours faithfully, Birmania
Yes, good idea! It also has the advantage to keep generating values in the lexicographical order, what permits to send emails in the received order 👍
I have started to use the "smtp-mailing-queue" plugin to send to subscribers published articles notification, within the limits of my provider. But I discovered that the number of emails sent did not match the number of subscribers. After analysis of the plugin code, I discovered that the PHP
microtime(true)
function is used to ensure uniqueness of stored email filename (in json format). But, unfortunately, the obtained precision is often not the microsecond as it depends on the float precision configured in php.ini. So a stored email can be overridden by a next one, as it gets the same microtime() result... Currently, as I cannot change the php configuration (shared server), I have workarounded that by adding "manually" a call to theusleep(20000)
function after each call to microtime() to ensure uniqueness, asmicrotime(true)
reports something like1595870079.9167
on my server. I think we should find a safer uniqueness provider!