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
It is not possible to record more than one conversion per second for the same visit #13727
Conversation
…the same visit fix #9916 we randomize the first 2 numbers increasing the chances to record multiple goal conversions per second per visit.
core/Tracker/GoalManager.php
Outdated
private function makeRandomMySqlUnsignedInt($length) | ||
{ | ||
// mysql int unsgined max value is 4294967295 so we cannot start with a 5 or higher | ||
return Common::getRandomString(1, '1234') . Common::getRandomString($length - 1, '0123456789'); |
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.
But couldn't this still create to high values between 4294967296 and 4999999999
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.
definitely, updated 👍
core/Tracker/GoalManager.php
Outdated
} | ||
if ($length > 2) { | ||
$randomInt .= Common::getRandomString($length - 2, '0123456789'); | ||
} |
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.
Actually even that could generate a too high number, even though the range is now much smaller between 4294967295 and 4299999999. Maybe it would be simpler to restrict the number to be between 1000000000 and 3999999999, e.g. disallow the 4 as first char?
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.
sure, makes totally sense.
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.
changed it.
fix #9916
we randomize the first 2 numbers increasing the chances to record multiple goal conversions per second per visit.