trezor-suite
trezor-suite copied to clipboard
Migration improvements
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
tagging @ondracja we might think a bit off upgrading our migration tests before merging this.
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?