linagora / james-project

Mirror of Apache James Project
Apache License 2.0
72 stars 62 forks source link

Each time update a draft on Thunderbird, Openpaas creates a new one for the update. #4329

Closed tlle14 closed 3 years ago

tlle14 commented 3 years ago

Actual Result

Each time updating a draft on Thunderbird, it creates another new draft on OpenPaas. For example, edit 3 times a draft on Thunderbird, OpenPaas make 3 copies of the draft.

Thunderbird: image

OpenPaas: image

Expected result

The draft should be updated on OpenPaas instead of making a new draft.

Environment

DEV platform Thunderbird, OpenPaas

chibenwa commented 3 years ago

Even after ctrl + f5 ?

Is this a new bug? Or can it be reproduced on openpaas.linagora.com?

tlle14 commented 3 years ago

Hi @chibenwa

  1. Even when you refresh the page, the duplicated drafts will not disappear.
  2. This is an old issue but I just have aware of it recently.
chibenwa commented 3 years ago

Ok. We will investigate.

@Arsnael is email query view activated on preprod? Can we activate it and re-test?

Arsnael commented 3 years ago

I will check

Arsnael commented 3 years ago

@chibenwa It is enabled in the jmap conf, and the corresponding listener is declared too. Bug then?

Arsnael commented 3 years ago

Ah no wait... @tlle14 is testing on dev not preprod (well because last I know openpaas not really up and running on preprod). Let me check and add it on dev

Arsnael commented 3 years ago

It's present on dev as well... I don't know then

chibenwa commented 3 years ago

And on openpaas.linagora.com.

I tested with samsung IMAP client, there is only a single email there. Also, ctrl + f5 and the extra mails do not disapear from OpenPaaS.

We likely want to investigate.

chibenwa commented 3 years ago

I have an idea for this one!

IMAP is based on an expunge model, which means the messages are flagged as \Deleted before actually removing messages. The actual deletion requires an EXPUNGE call.

Of course, other IMAP clients do not display \Deleted emails while I do think JMAP do!

So the way to fix it could be to have Email/query not returning \Deleted messages. This could be done:

chibenwa commented 3 years ago

Bingo, confirmed!

Right click on Draft folder + compact does actually do the Expunge, and the extra mails disapear from JMAP.

chibenwa commented 3 years ago

https://issues.apache.org/jira/browse/JAMES-3597

chibenwa commented 3 years ago

https://github.com/apache/james-project/pull/490

tlle14 commented 3 years ago

@chibenwa @Arsnael The duplicated draft was displaying until I refreshed the page. Do you have any solution to automatically refresh the mailbox? Peek 2021-06-16 09-52

Arsnael commented 3 years ago

Can try to check a little but this likely looks like an openpaas issue. I would bet maybe when you click on the little refresh arrow on top it likely just check for new messages, while clicking on the mailbox does a full getMessagesList...

Will try to confirm that :)

chibenwa commented 3 years ago

The duplicated draft was displaying until I refreshed the page.

Expected. Deletes are not synched by OpenPaaS. If I delete an email in window A, then the email can be seen in window b until I f5.

I close the issue.