-
Notifications
You must be signed in to change notification settings - Fork 271
fix(db): Hash long IMAP message IDs #10178
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Christoph Wurst <[email protected]>
lib/Db/MessageMapper.php
Outdated
@@ -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), |
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.
How often will the prefix of thread_root_id
be the same causing collisions? Would hashing to 1k bytes provide better resiliency against collisions?
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.
Hard to say. Hashing long values could be a good idea for long messages. I'll look into that!
Signed-off-by: Christoph Wurst <[email protected]>
I'm getting unsure about the approach, regardless of going with truncation or hashing. The INSERTs and UPDATEs will be fine. But threading might fall apart when we use the header information later to build threads. E.g. in |
Fixes #6618.