-
-
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
chore: metadata refactoring 4 #9560
Conversation
1ebab0e
to
8c5029c
Compare
94f0f29
to
64c0a3c
Compare
c87651f
to
ce866ba
Compare
packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx
Outdated
Show resolved
Hide resolved
@@ -213,6 +214,8 @@ export const rememberDevice = | |||
if (!(await db.isAccessible())) return; | |||
if (!device || !device.features || !device.state) return; | |||
if (!remember) { | |||
// eslint-disable-next-line @typescript-eslint/no-use-before-define | |||
dispatch(forgetDeviceMetadataError(device)); |
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 - why not just move it up or down? 🤷
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.
sometimes it is not possible. not sure how about this case. here I guess motivation might have been not making too many changes for review. I can try to move it as it is reviewed now.
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.
I'm sorry for the nitpicks, feel free to close them directly or even ignore them. In general it looks great and works so far very smooth 🎉
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.
🎉 Let's rebase it
…tion) in nested calls
…us and init action
…t, e2e tests added
202e077
to
dbbc915
Compare
In this PR I am separating code from #9130 which is not features. so basically everything from #9130 except for confirm-less labeling and migration was moved to this PR.
While working on #9130 I noticed couple of problems which might have been around for long time or might have been introduced in one of the previous requests on the were merged along the way to the confirm-less labeling feature (#9108, #9218, #9262, #9270)
commits:
account.key
anddevice.state
and it was necessary to usein
operator frequently. Now we are using everywhereentity.key
abstraction narrowing defined in a newly added selector.getLabelableEntities
which was actually a selector to metadataReducer.device.metadata.status ('disabled' || 'cancelled' || 'enabled')
. This is mostyl types simplification. Previously,metadata[encryptionVersion]...
was bound withmetadata.status.enabled
and it was needed to usein
operator in my opinion superfluously.cancelled
status is replaced by newly addedmetadata.error
which is basicallymetadata.failedMigration
field introduced in metadata encryption v2 (confirm-less labeling) #9130. When error is set, suite does not try to init metadata automatically.encryptAndSaveMetadata
action andfetchMetadata
actions should never handle their errors and only return results to their caller. The reason is that caller knows whether these actions are run in batch and is in better position to handle errors. In other words - if error is handled in an atomic action we might fire dozens of notifications in case of error which we obviously don't want to do.'cancelled'
actually changes behaviour of app. we need to make a note that user cancelled labeling on device so that we know that in the next run we don't want to trigger this dialogue again. Also this field will be reused in metadata encryption v2 (confirm-less labeling) #9130 where I named itmetadata.failedMigration
but I believe that naming in this PRmetadata.error
is actually better.metadata.error
, while not leaking info about number of used passphrases. This information follows fate of device (remember/forget)Screamshots
Trying to enable labeling for other than currently selected device should work
When there are more saved wallets, all should load their labels after app reload. not only the selected one.