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:
Damien Elmes 2021-06-02 17:12:59 +10:00
parent e8d1a035a2
commit 2903848c62

View file

@ -162,7 +162,9 @@ impl SqliteStorage {
})
.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.db.execute_batch("update col set dconf=''")?;