Skip to content

Conversation

@link2xt
Copy link
Collaborator

@link2xt link2xt commented Dec 23, 2025

Closes #7622
Closes #7623

Replacement for #7624

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a database migration (version 144) to automatically reset three configuration options for chatmail profiles that should not be available or set for these accounts. The migration addresses user reports where incorrect settings prevented them from adding relays or caused issues with the expiry script on chatmail servers.

  • Deletes only_fetch_mvbox and show_emails config keys for chatmail accounts
  • Resets mvbox_move to '0' (disabled) for chatmail accounts
  • Only applies changes if the account is identified as a chatmail profile

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1469 to +1498
inc_and_check(&mut migration_version, 144)?;
if dbversion < migration_version {
sql.execute_migration_transaction(
|transaction| {
let is_chatmail = transaction
.query_row(
"SELECT value FROM config WHERE keyname='is_chatmail'",
(),
|row| {
let value: String = row.get(0)?;
Ok(value)
},
)
.optional()?
.as_deref()
== Some("1");

if is_chatmail {
transaction.execute_batch(
"DELETE FROM config WHERE keyname='only_fetch_mvbox';
DELETE FROM config WHERE keyname='show_emails';
UPDATE config SET value='0' WHERE keyname='mvbox_move'",
)?;
}
Ok(())
},
migration_version,
)
.await?;
}
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration resets chatmail profile options that should not be set, but there is no test coverage for this migration. Consider adding a test case similar to the existing migration tests that:

  1. Sets up a chatmail profile with these config values set incorrectly
  2. Runs the migration
  3. Verifies that only_fetch_mvbox and show_emails are deleted and mvbox_move is set to '0'

This would help ensure the migration works correctly and prevent regressions.

Copilot uses AI. Check for mistakes.
@link2xt link2xt merged commit 1847367 into main Dec 24, 2025
61 of 62 checks passed
@link2xt link2xt deleted the link2xt/zkvpnntmulur branch December 24, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Older chatmail addresses may have "move to deltachat folder" enabled and can not disable it anymore chatmail user can't add relay

3 participants