`bcc_self` is reverted to 0 after upgrade of existing multi-device setup
link2xt opened this issue · comments
Users report that in a setup with Android (1.50.4 from F-Droid) and Desktop (1.48.0 x86_64 .deb release) and chatmail account bcc_self
was reverted to 0 on Android, resulting in messages send from Android not appearing on Desktop. The setting is not displayed on Android for chatmail accounts, but as a workaround, exporting a backup on Android and immediately destroying it worked. Upgrading Desktop to 1.50.1 did not result in bcc_self
reverting there to 0.
The problem was likely introduced in #6344
This change is part of core 1.153.0. Android 1.50.3 uses core 1.152.0 and Android 1.50.4 uses core 1.153.0. Desktop 1.50.1 still uses core 1.152.1, this is likely why the problem did not appear there yet, it may still revert to bcc_self=0
after upgrade.
Migration in #6344 inserts bcc_self=1
into config
table if config
table contains delete_server_after=0
. If delete_server_after
simply does not exist in the table, then migration does nothing.
Maybe the migration should have been INSERT OR REPLACE
, not INSERT OR IGNORE
. Maybe the user switched the setting back and forth when it was still not hidden, then migration does nothing.
Unless someone finds other reasons for why this could have happened, I suggest we copy the migration, but now with INSERT OR REPLACE
instead of INSERT OR IGNORE
, and let it run once again.
We don't have a clear way to reproduce it and it does not seem to happen to any of developers, so maybe it's a rare case. I upgraded all my devices to the latest core and don't have this bug.
Since bcc_self
essentially means "multi-device", one way to automatically fix this case would be to enable it when we see outgoing message, or at least every time we download a sync message. Sync message in our inbox is a clear indication that we have a multi-device setup.
I think this might happen because of the bug in the migration, it should actually be
"INSERT OR IGNORE INTO config (keyname, value)
SELECT 'bcc_self', '1'
FROM config WHERE keyname='delete_server_after' AND value!='1'
instead of ... AND value='0'
. The user might set delete_server_after
to some value other than 0 or 1 when that was possible in UIs.