Skip to content
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

Trash not sync'ing correctly #3605

Closed
lordkage opened this issue Sep 9, 2018 · 15 comments
Closed

Trash not sync'ing correctly #3605

lordkage opened this issue Sep 9, 2018 · 15 comments
Labels
status: needs information Needs more information to proceed type: bug Something is causing incorrect behavior or errors

Comments

@lordkage
Copy link

lordkage commented Sep 9, 2018

The behavior changed after last release.

Expected behavior

When a message is moved to the Trash, it is moved to the Trash locally and on the server. If a sync is issued on that folder, then the local Trash will reflect the changes of the server, including any recently moved messages.

Actual behavior

The messages are being moved to the Trash, but when it is synchronized with the server, it is duplicating the messages locally. Then when the delete is issued from the server side and a subsequent sync happens on the Trash folder, the remote duplicates are removed, but the local duplicates remain. The server has no reference to the messages in the Trash, and as far as it knows, it is empty. However, K9 believes there are messages in the Trash folder. Repeated sync's do not remove them. Clearing messages locally will remove the duplicate messages.

Steps to reproduce

  1. Delete message
  2. Sync Trash folder
  3. Observe duplicate messages
  4. Empty Trash via server (aka, another interface)
  5. Sync Trash folder
  6. Observer locally moves messages still appearing in Trash
  7. Clear local messages from Trash folder
  8. Messages are gone

Environment

K-9 Mail version:
5.600

Android version:
8.1.0

Account type (IMAP, POP3, WebDAV/Exchange):
IMAP

@cketti
Copy link
Member

cketti commented Sep 10, 2018

Can you please record a debug log while deleting a message. See https://github.com/k9mail/k-9/wiki/LoggingErrors

Deleting a message in K-9 Mail first moves the message to the local trash folder. But as soon as the server command to move the message completes, the local message should be updated to point to the remote message in the Trash folder. From your description it sounds like the last step doesn't happen in your setup.

@cketti cketti added type: bug Something is causing incorrect behavior or errors status: needs information Needs more information to proceed labels Sep 10, 2018
@CueHD
Copy link

CueHD commented Sep 17, 2018

This is happening to me as well. It is happening with two IMAP accounts just as described above. It only began doing this after the most recent update. If a log has not been provided already, I will try and generate one later this week when I am at my main laptop.

Also, when messages are deleted from local trash, they are not deleted from the server.

Steps to reproduce
Delete message via K9
Sync Trash folder
Empty Trash via K9
Sync Trash folder
Messages are still in the Trash folder when accessing via webmail
Clear Trash via Webmail
Messages are gone

Environment
K-9 Mail version:
5.600

Android version:
8.0.0

Account type:
IMAP

@lordkage
Copy link
Author

I am having issues retrieving the log from my personal system, and I do not wish to install the Android SDK onto my work computer. @CueHD if you could provide a log before I can figure out how to extract one, then please beat me to it. 😀

@Heycz
Copy link

Heycz commented Sep 28, 2018

Delete msg commond:
UID COPY 1465203373 "Trash"
UID STORE 1465203373 +FLAGS.SILENT (\Deleted)

delete succuess,but when sync:
09-28 16:59:36.758 10282-10377/? V/k9: conn92385403>>> 5 SELECT "Trash"
09-28 16:59:36.767 10282-10377/? V/k9: conn92385403<<<#null# [0, EXISTS]

then the remoteMessageCount =0,so the ui list has no msg

@wurstsemmel
Copy link

wurstsemmel commented Oct 17, 2018

I observe the same behaviour as @lordkage and in addition deleted messages show up in the webinterface of my e-mail provider marked as deleted (but still present). After manually executing "expunge" on K-9, messages are deleted completely from webinterface.

Expected behavior

After deleting a message in K-9, this message shows up in folder trash in K-9 and webinterface. Trash is emptied via at least two different paths:

  • Deleting this message from folder trash in webinterface deletes the message from folder trash in K-9.
  • Deleting this message from folder trash in K-9 deletes the message from folder trash in webinterface without manually executing "expunge" in K-9 (see settings under section environment).

Actual behavior

After deleting a message in K-9, this message shows up twice in folder trash in K-9 and once in webinterface. Trash is emptied via at least two different paths:

  • Deleting this message from folder trash in webinterface deletes one of the two messages from folder trash in K-9.
  • Deleting both messages from folder trash in K-9 marks the message as deleted in folder trash in webinterface. After manually executing "expunge" in K-9 the message is completely removed from webinterface.

Summary

No duplicate messages should be in trash and deleting from trash should trigger expunge.

Steps to reproduce (reproducibility: always)

Send message to yourself

Delete message from inbox
Sync trash folder (K-9)
Observe duplicate messages in trash folder (K-9) and single message in webinterface
Empty trash folder in webinterface
Sync trash folder (K-9)
Observe one message in trash folder (K-9)
Delete message from trash folder (K-9)

Delete message from sent items
Sync trash folder (K-9)
Observe duplicate messages in trash folder (K-9)
Empty trash folder in K-9
Observe message marked as deleted in webinterface
Manually execute "expunge" on K-9
Messages deleted completely in webinterface

The log file after executing above steps is available here @cketti : k9-log.txt

Environment

K-9 Mail version:
5.600
fresh install
Settings -> Account Settings -> Fetching Mail -> Erase deleted messages on server -> Immediately

Android version:
8.0.0 (OnePlus 3 with OxygenOS 5.0.5)

Account type (IMAP, POP3, WebDAV/Exchange):
IMAP

@dclubb
Copy link

dclubb commented Feb 3, 2019

For those affected by this issue, were you able to figure out a workaround?

@lordkage
Copy link
Author

lordkage commented Feb 3, 2019

Nope. I make sure to delete my messages using a different interface, then "clear local message" from the trash to remove any local copies.

@CueHD
Copy link

CueHD commented Mar 14, 2019

I have found a work around. While deleting individual messages from the Trash folder in K9, the message is still in the trash folder on the server. However, both of the "Empty Trash" buttons do appear
to remove the messages from the server.
The two buttons are:
From within an account's folder list, select the options menu and click "Empty Trash"
or
From the K9 account list, long press on an account and click "Empty Trash".

@ghost
Copy link

ghost commented Apr 14, 2019

This is a very annoying bug, which hits me very hard, since I have several mail accounts. I usually delete a single message only.

Here are what I have to do to delete a message:

  • Delete message. -> Message is duplicated in the trash, one is synced with the server, the other not.
  • Delete both messages from the trash -> The synced message on the server is marked as deleted. The other message is really deleted.
  • Log in to the webmail, go to the trash-folder and finally delete the "marked as deleted" message.

Please fix this bug.

Possible related and/or duplicate: #4008, #3903, #3801, #3355, #2705

@CueHD
Copy link

CueHD commented Apr 15, 2019

Another potential concern with this issue is what "Empty Trash" does. Preciously, I had been deleting items from the trash to remove them from both my device and the server. Now, I must use "Empty Trash" to do this. However when I empty trash from K9, it empties the enitire trash from the server, not only the messages located in K9.
While I realize that this is likely the desired outcome, it means that we currently have no easy way to remove messages deleted by K9 from the server without emptying the entire trash.

@daviwph
Copy link

daviwph commented May 16, 2019

It may be helpful to know that Version 5.600 appeared to be working normally when used with a GoDaddy IMAP server. The duplicate trash issue developed when I move to a Network Solutions IMAP server. Deleted mail is added to the Trash folder on the server as expected. As the K9 trash folder updates, two of each deleted message appear. When the Trash folder is purged on the server via a desktop client, the duplicate messages remain on the Trash folder on the phone. I delete them by using "Clear Local Messages". Other then this issue with the Trash folder, the Network Solutions IMAP server works normally.

@alexandre1985
Copy link

alexandre1985 commented Jun 24, 2019

I also have the same problem that @lordkage posted on the opening post.

I don't know about using a "webinterface" as @wurstsemmel says. When I delete my message I do it on K9 and I always follow with an clearing of trash inside K9.

I believe that (when deleting an email) K9 moving the message to Trash folder locally could be removed and instead do an email move to Trash folder only on the server.
Then, when viewing the Trash folder on K9, it could do a fetch of Trash folder emails from the server.

Doing so, it would not create duplicate emails inside the Trash folder when deleting email. This is exactly what I want.

This solution, would remove my issue.

Thank you for the OpenSource solution of K9. This is the only issue that I have using it, so for me everything else that K9 delivers is good 😉

@cketti
Copy link
Member

cketti commented Oct 6, 2020

This should no longer be an issue in K-9 Mail 5.7xx.

@cketti cketti closed this as completed Oct 6, 2020
@lordkage
Copy link
Author

lordkage commented Oct 9, 2020

Is that a beta version or a release version?

@cketti
Copy link
Member

cketti commented Oct 9, 2020

It's a beta version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs information Needs more information to proceed type: bug Something is causing incorrect behavior or errors
Projects
None yet
Development

No branches or pull requests

8 participants