-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Duplicate folder entries in the database #1220
Comments
I found this. I don't know what causes it, but what happens is we get back two entries for the same I added a temporary fix to my dev code here (the outer if block): https://github.com/philipwhiuk/k-9/blob/master/k9mail/src/main/java/com/fsck/k9/activity/FolderList.java#L780 I don't really want to push it because it's not actually fixing the problem, just hiding it. It looks like And that just does a DB query, so there's a database duplication issue somewhere. That's hard to easily debug, so there's some investigation to do. Its only a visual thing, because they both return the same underlying instance. If we were passing a Set not a list we'd never have known. |
Thanks for the help but I must admit I understood nothing. Said in other words: is it a known problem? Is there any idea why it appears in one phone and not in the other? |
It's a problem I was vaguely aware of but hadn't written a bug for (mainly because I often hit bugs which are only present in unreleased code). The analysis was mainly for me / another person who wants to try and fix it at some point (e.g. before the next stable release). As for why it happens in only one phone, I don't know. It may be luck. It may be just a matter of time. Heck it may be possible you'll get three eventually :( I think if you delete the account or possibly just 'Recreate data' the extra entries should go. Can't promise they won't come back at some point until I know why it's being dupe'd though. |
Ok, thanks. Would you please tell me where the "recreate data" is? |
Long-tap on the account in the accounts list. |
Thanks a lot! It worked! Thank you so much! |
In terms of fixing this: We are clearly creating the same folder in the DB twice. There are two calls to create a DB entry, MessagingController.doRefreshRemote and LocalFolder.create. Both do check for pre-existence, but outside a DB lock. I think the only reason this can occur is that they are running simultaneously. However there's lots of calls to create making it very difficult to work out exactly why this is. One solution is just do a second check while we have the DB lock and silently return if it exists. We could optionally also log a stack of where this occurring for debugging purposes, but unless we add something like ACRA we're never going to know for 99% of cases that it's occurring. |
We could make the code only throw for debug builds (use |
Could this be triggered by the Import settings feature? |
Importing the same account settings twice can cause this problem. I just had the problem occur after importing my account settings twice. There were duplicate Outbox and Trash folders. I fixed it by deleting the account and then importing the account settings just once. |
I had 2 copies of the Outbox folder in a Gmail account. Recreate data warns that it is a "last resort", so I decided to just change the Folder Display Class to hide it instead. |
We only crash on 'developer mode' builds. See issue #1220
Will we ever see this fixed? The recreate data does not help. As soon as mail is fetched the next time after doing so the duplicates re-appear. |
Similar issue for me.
I get 12 folders, and only the Inbox seems to be correctly used:
I believe it's an error when mapping the folders, and may appear on translated versions of K9 only? |
I believe this is no longer an issue with |
Had the problem with version 5.600 |
had to force quit and do it a third time |
I installed the latest k9 mail version taken from the play store on both my identical phones (two elephone trunks with Android 5.1) but in one of them k9 is showing a very strange behavior:
in fact, there are two trash folders and even if I check on Gmail desktop via web, everything is normal.
So I don't know what's causing this issue and need your help.
Thanks and happy Easter!
The text was updated successfully, but these errors were encountered: