mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
Fix contact name update rules
The following rules apply now: 1. "name" column is only updated manually and never over the network 2. "authname" column is only updated over the network and never manually 3. Displayname is a "name" if it is non-empty, otherwise it is "authname". This fixes a known (pytest.xfail) problem of "name" being changed over the network when user has set it to non-empty string manually. This also fixes the problem when "name" and "authname" became unsynchronized accidentally, when they were equal and then Origin::IncomingUnknownTo update arrived, setting "name" but not "authname". Rust regression test is added for this case.
This commit is contained in:
@@ -1491,6 +1491,15 @@ CREATE INDEX devmsglabels_index1 ON devmsglabels (label);
|
||||
}
|
||||
sql.set_raw_config_int(context, "dbversion", 73).await?;
|
||||
}
|
||||
if dbversion < 74 {
|
||||
info!(context, "[migration] v74");
|
||||
sql.execute(
|
||||
"UPDATE contacts SET name='' WHERE name=authname",
|
||||
paramsv![],
|
||||
)
|
||||
.await?;
|
||||
sql.set_raw_config_int(context, "dbversion", 74).await?;
|
||||
}
|
||||
|
||||
// (2) updates that require high-level objects
|
||||
// (the structure is complete now and all objects are usable)
|
||||
|
||||
Reference in New Issue
Block a user