Skip to content
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

Truncate userId to prevent error data too long #16250

Merged
merged 1 commit into from Jul 31, 2020
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jul 28, 2020

fix #16249

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Jul 28, 2020
@tsteur tsteur added this to the Priority Backlog (Help wanted) milestone Jul 28, 2020
@@ -55,7 +55,11 @@ public function __construct()
*/
public function onNewVisit(Request $request, Visitor $visitor, $action)
{
return $request->getForcedUserId();
$value = $request->getForcedUserId();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to truncate the data in getForcedUserId() directly. Should someone use > 200 characters then the visitorId will still be different for different visitors this way (as it does like substr(sha1($userId), 0, 16))

@diosmosis diosmosis merged commit 305cfa0 into 4.x-dev Jul 31, 2020
@diosmosis diosmosis deleted the maxlenuserid branch July 31, 2020 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL error: Data too long for column 'user_id'
3 participants