Details
Details
Tested later in the stack
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- publish-flow-fixes
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
The conditions look correct, I only added a suggestion on how to improve reliability. I analyzed the following cases:
| Device type | Device list | Has backup | shouldDoMigration | shouldCreateUserKeysBackup | resulting action | notes |
| Primary | signed | Yes | false | false | early return L148 | correct, no action |
| Primary | signed | No | false | true | create user keys backup | is this case ever possible?* ⬅ |
| Any | unsigned | Yes | true | false | perform migration (replace backup) | correct |
| Any | unsigned | No | true | false | perform migration (create backup) | correct |
| Secondary | signed | No | - | - | early return L135 | correct |
| Secondary | signed | Yes | - | - | early return L135 | correct, not sure if ever possible** |
*My guess is that it's the case right after registration when we have initial signed device list but no backup yet.
**Secondary devices don`t have backup
| native/backup/backup-handler.js | ||
|---|---|---|
| 128–136 | I'd probably move the const shouldDoMigration above and use it here, it initially confused me because there are now two early exits separated by these variable declarations | |