trezor-suite icon indicating copy to clipboard operation
trezor-suite copied to clipboard

Migration improvements

Open marekrjpolak opened this issue 2 years ago • 2 comments

IDB migrations improvements, with descending importance and ascending risk of breaking something.

https://github.com/trezor/trezor-suite/pull/6431/commits/a2b2a1949baefe5f70e6f66ce22e62a2a847c22a - fix, important - awaiting async db operations which were not awaited. https://github.com/trezor/trezor-suite/pull/6431/commits/5aac620c1517ea43505cb534705ab5e6fc805b4d - optional - DB initialization is now equivalent to migrating from the oldest supported version, therefore duplicate createObjectStore etc. is not needed anymore. https://github.com/trezor/trezor-suite/pull/6431/commits/9c14f53f9112d3982ba91b92608c07a002ecc634 - optional - implemented updateAll util function to remove recurring iteration pattern from migrations. Also, reading entities one by one was replaced by store.getAll() method. https://github.com/trezor/trezor-suite/pull/6431/commits/785aa3a2bc21871f796be552a7533854ac15eef4 - optional - migrations split into files and iterated from outside.

MUST BE THOROUGHLY TESTED

marekrjpolak avatar Sep 30 '22 09:09 marekrjpolak

tagging @ondracja we might think a bit off upgrading our migration tests before merging this.

mroz22 avatar Oct 03 '22 09:10 mroz22

tagging @ondracja we might think a bit off upgrading our migration tests before merging this.

I totally agree, but maybe we should merge at least the first commit?

marekrjpolak avatar Oct 03 '22 09:10 marekrjpolak