thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/mobile
Apache License 2.0
11.02k stars 2.51k forks source link

Inbox is being treated as an outbox and has a bad database state, and `outboxFolderId` points to it #8416

Open s-zeid opened 4 weeks ago

s-zeid commented 4 weeks ago

Checklist

App

Thunderbird for Android

App version

8.0b4

Where did you get the app from?

Google Play

Android version

12; LineageOS 19-20230817-NIGHTLY-h918

Device model

LG V20 H918

Steps to reproduce

I don't know how to get an account into this state.

I am concurrently experiencing #8049/#6680. I've been getting IllegalStateException: No outbox_state entry for message with id 1 notifications within the last few days, after having updated to 8.0b4, with the icon color matching (only) that of the buggy account.

While investigating, I noticed that there was no Outbox folder in the sidebar for the account in question, and I came across #5926, so I tried sending two test messages from the (one to the same account, and one to another configured account, which appeared to fail with a new IllegalStateException notification but did actually appear in the respective accounts' inboxes. No Outbox folder was created as would be expected.

I began using TBA with the 8.0b1 release. If i recall correctly, the buggy account is the second out of three accounts that I configured. I did at one point manually enable sync (all accounts) and disable push (buggy account) in the Inbox folder settings.

(While writing this issue, I received a notification for a test message that I had sent earlier (and thus already received).)

Expected behavior

The inbox folder should behave normally and not as an outbox.

The database state should be correct:

All three accounts were freshly configured when I first installed the app as Thunderbird for Android 8.0b1, so I would expect the buggy account to have an outbox on ID 1 and the inbox on ID 2 like the other two accounts, and I would expect all three account databases to be consistent in whether the display_class and poll_class fields exist.

Actual behavior

The inbox behaves as if it were the outbox, but it still shows the inbox's messages. Specifically:

(I do not recall if the inbox behaved this way prior to my testing. I normally use the Unified Inbox. I also do not know what the state of any account's folders table was prior to sending the test messages.)

The folders table row with ID 1 in the buggy account's database looks like this:

All accounts have outboxFolderId set to 1, and the two non-buggy ones have an outbox on folder ID 1. The outbox_state tables of all accounts were empty at the time I pulled the databases from my device.

Output of sqlite3 -line <db file> 'select * from folders where id = 1;':

Logs

No response