fix(imap): stop re-probing genuine multi-folder copies every sync

repairRelocated() probed every row whose Message-ID was also filed in another
folder. A message that genuinely lives in two folders survived every probe,
collapse() returned 0, and it was back on the work list next sync, costing a
round trip per copy per poll and filling the 100-row slice so real ghosts
behind it waited. Confirmed copies now get message.copies_confirmed_at (new
migration) and are left out of findMessageIdsAlsoFiledElsewhere() for 30 days.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Paul LütznerandClaude Opus 5.5 committed 2026-09-23 19:14:14 +02:00
1 parent 5cc6753649
commit b9238ab019
5 files changed
+120 -18

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Remember messages the server confirmed are genuinely in two folders.
*
* The relocated-duplicates repair probed every such copy over IMAP on every
* sync, found them all still there, and did the same again next time. Null on
* every existing row, which is what makes each one be checked once.
*/
final class Version20260923101300 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add message.copies_confirmed_at.';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE message ADD copies_confirmed_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE message DROP copies_confirmed_at');
}
}