Skip to content

Commit 0f94529

Browse files
committed
feat: reset all indirect verifications
1 parent 94919ac commit 0f94529

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/sql/migrations.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,16 @@ CREATE INDEX gossip_timestamp_index ON gossip_timestamp (chat_id, fingerprint);
12611261
.await?;
12621262
}
12631263

1264+
inc_and_check(&mut migration_version, 134)?;
1265+
if dbversion < migration_version {
1266+
// Reset all indirect verifications.
1267+
sql.execute_migration(
1268+
"UPDATE contacts SET verifier=0 WHERE verifier!=1",
1269+
migration_version,
1270+
)
1271+
.await?;
1272+
}
1273+
12641274
let new_version = sql
12651275
.get_raw_config_int(VERSION_CFG)
12661276
.await?

src/sql/migrations/migrations_tests.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ async fn test_key_contacts_migration_verified() -> Result<()> {
159159
INSERT INTO chats_contacts VALUES(10,10,1745609547,0);
160160
"#,
161161
)?)).await?;
162-
t.sql.run_migrations(&t).await?;
162+
163+
STOP_MIGRATIONS_AT
164+
.scope(133, t.sql.run_migrations(&t))
165+
.await?;
163166

164167
// Hidden address-contact can't be looked up.
165168
assert!(

0 commit comments

Comments
 (0)