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

fix(db): Truncate long IMAP message IDs #10178

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ChristophWurst
Copy link
Member

Fixes #6618.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@@ -235,7 +235,7 @@ public function writeThreadIds(array $messages): void {
foreach ($messages as $message) {
$query->setParameter(
'thread_root_id',
$message->getThreadRootId(),
mb_substr($message->getThreadRootId(), 0, 1023),

Choose a reason for hiding this comment

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

How often will the prefix of thread_root_id be the same causing collisions? Would hashing to 1k bytes provide better resiliency against collisions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hard to say. Hashing long values could be a good idea for long messages. I'll look into that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'in_reply_to' at row 1
2 participants