-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metadata: encryption version migration #8825
Conversation
4f244e0
to
b5ed29f
Compare
bf8966e
to
ea07c7a
Compare
37254af
to
8bbad83
Compare
b5ed29f
to
26f0684
Compare
8bbad83
to
905904b
Compare
if (entity.type === 'device' && entity.status !== 'enabled') { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this? sometimes not fetch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for TS. but basically, what would you fetch if you don't have metadata enabled? 🤔
const entityData = entity[encryptionVersion]; | ||
if (!entityData) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes me think "what does entityData
mean?"
what about just?
if (!entity[encryptionVersion]) return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then there is const { fileName, aesKey } = entityData;
on the next line anyways
const defaultEntityData = | ||
entity.type === 'account' | ||
? ({ | ||
accountLabel: '', | ||
outputLabels: {}, | ||
addressLabels: {}, | ||
} as AccountLabels) | ||
: ({ walletLabel: '' } as WalletLabels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nitpick to think about. I think we are already defining this on a couple of places, maybe it could go to some single point of definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!filesToMigrate || !filesToMigrate.length) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick according to m personal taste
!filesToMigrate?.length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c920d4e
to
70414f3
Compare
c6a3cb9
to
6736de5
Compare
ab6f1f0
to
913bf8a
Compare
913bf8a
to
0dbbe39
Compare
Based on #8646 which is a PR that introduces changes to metadata data model in reducers. That PR is basically ready to be merged but as it does not bring any new features I am hesitant to do it. Also I dont want to bloat it with more changes so I decided to build on it instead. I am also stealing some ideas from #8567
Commits
device.metadata.key
should also be versioned as it determinesaccount.metadata.aesKey
andaccount.metadata.fileName
. This fixup is incomplete, there are also some changes in the second commit that should go here.Todos:
How does it work
Testing tips
Drawbacks