mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
handle duplicate ids in values when upgrading deck config
Multiple configs with the same inner id would lead to errors like the following when trying to open the collection: DeckConfigInner.interval_multiplier: invalid wire type: StartGroup (expected ThirtyTwoBit)
This commit is contained in:
parent
e8d1a035a2
commit
2903848c62
1 changed files with 3 additions and 1 deletions
|
@ -162,7 +162,9 @@ impl SqliteStorage {
|
||||||
})
|
})
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
})?;
|
})?;
|
||||||
for (_, mut conf) in conf.into_iter() {
|
for (id, mut conf) in conf.into_iter() {
|
||||||
|
// buggy clients may have failed to set inner id to match hash key
|
||||||
|
conf.id = id;
|
||||||
self.add_deck_conf_schema14(&mut conf)?;
|
self.add_deck_conf_schema14(&mut conf)?;
|
||||||
}
|
}
|
||||||
self.db.execute_batch("update col set dconf=''")?;
|
self.db.execute_batch("update col set dconf=''")?;
|
||||||
|
|
Loading…
Reference in a new issue