linagora / james-project

Mirror of Apache James Project
Apache License 2.0
70 stars 63 forks source link

Inconsistencies: need a task to rebuild messagedeleted table #5235

Open chibenwa opened 1 month ago

chibenwa commented 1 month ago

Why?

I observed some inconsistencies between messagedeleted and messageidtable on CNB

Some missing entries on both side.

Impact: some mails marked as deleted can not be undeleted

Workaround: unmark them as deleted, re-mark them as deleted, and expunge

What

Have a task that rebuild the messagedeleted projection:

curl -XPOST /mailboxes?action=SolveMessageDeletedInconsistencies

For each mailbox, crears the messagedeleted entry, list mailbox content and re-creates the necessary entries.

While we are at it we can likely do too the mailboxrecents table.

curl -XPOST /mailboxes?action=SolveMailboxRecentInconsistencies

Definition of done

We thus needs: webadmin task, task serialization, additional details serialization, webadmin routes and tests, guice bindings and 1 little integration test for both, documentation.

vttranlina commented 3 weeks ago

I'm not clear

Workaround: unmark them as deleted, re-mark them as deleted, and expunge For each mailbox, crears the messagedeleted entry, list mailbox content and re-creates the necessary entries.

Can you explain more?

chibenwa commented 3 weeks ago

That is not important for executing this task.

Sorry, vacations, i'll explain next week if needed.

Arsnael commented 2 weeks ago

For each mailbox, crears the messagedeleted entry, list mailbox content and re-creates the necessary entries.

Team is asking for something more clear.

I believe for each mailbox we clear all the entries of that mailbox in messageDeleted projection table, then list mailbox content (messageIdTable) with mails marked as deleted, and recreate the necessary entries in messagedeleted table. Correct?

chibenwa commented 2 weeks ago

Yes

In the end we just need a way to implement a fix to messagedeleted table.

The exact algorithm can be adapted if need be