deltachat / deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
https://delta.chat/en/contribute
Other
659 stars 85 forks source link

refactor: Protect from reusing migration versions (#5719) #5721

Closed iequidoo closed 3 months ago

iequidoo commented 3 months ago

so, i would try to improve more on-point - preventing #5719 is really worth thinking about as it happens easily in parallel PR development:

  • what about a runtime-check for the number given to execute_migration() - if an already used number is given, it will error out.

I agree, let's not change it too much. Added such a check to execute_migration(), but also a check for exact migration version to the last migration. Maybe it's redundant though. I wanted it to be a compile-time check, but seems it's not possible in Rust.