-
Notifications
You must be signed in to change notification settings - Fork 286
feat: store envelopes as list of threads #11529
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: Hamza <[email protected]>
Signed-off-by: Hamza <[email protected]>
5788190
to
0100ddb
Compare
lib/Db/MessageMapper.php
Outdated
$res = $qb->executeQuery(); | ||
while ($row = $res->fetch()) { | ||
$message = $this->mapRowToEntity($row); | ||
if ($message->getThreadRootId() === null) { | ||
$results[] = [$message]; | ||
} else { | ||
$results[] = $this->findThread($account, $message->getThreadRootId(), $sortOrder); |
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.
I think the n+1 can be avoided with a subquery or self join
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.
When called from getDatabaseSyncChanges
I wonder if it's even necessary to fetch messages of the same thread. We already know the new IDs. Other messages are not relevant, are they?
lib/Db/MessageMapper.php
Outdated
$res = $qb->executeQuery(); | ||
while ($row = $res->fetch()) { | ||
$message = $this->mapRowToEntity($row); | ||
if ($message->getThreadRootId() === null) { | ||
$results[] = [$message]; | ||
} else { | ||
$results[] = $this->findThread($account, $message->getThreadRootId(), $sortOrder); |
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.
Same here
Signed-off-by: Hamza <[email protected]>
Ref #11065 (comment)