Skip to content

Conversation

hamza221
Copy link
Contributor

@hamza221 hamza221 commented Aug 19, 2025

Comment on lines 1330 to 1336
$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);
Copy link
Member

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

Copy link
Member

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?

Comment on lines 1399 to 1405
$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);
Copy link
Member

Choose a reason for hiding this comment

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

Same here

@ChristophWurst
Copy link
Member

Looks good so far

  • BUG while clicking through mailboxes
image

@ChristophWurst
Copy link
Member

  • BUG when I click on a thread
image

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.

2 participants