Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

JSON Keyfile backup #101 #260

Merged
merged 34 commits into from
Dec 12, 2018
Merged

JSON Keyfile backup #101 #260

merged 34 commits into from
Dec 12, 2018

Conversation

pmespresso
Copy link
Contributor

@pmespresso pmespresso commented Nov 20, 2018

#101

todo:

  • add option to export json keyfile to backup from Account
  • json encoding check
  • clean up duplicated code in store
  • add import options screen

todo:
* add option to export json keyfile to backup
* clean up duplicated code in store
uses react-dropzone
@pmespresso pmespresso changed the title WIP: JSON Keyfile backup #101 JSON Keyfile backup #101 Nov 21, 2018
Copy link
Contributor

@axelchalon axelchalon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool :)

I tried exporting to json an existing account in Fether and importing it again and it gave me an account with a different address than that in the json file, not sure why that is

packages/fether-react/package.json Outdated Show resolved Hide resolved
packages/fether-react/src/stores/createAccountStore.js Outdated Show resolved Hide resolved
packages/fether-react/src/stores/createAccountStore.js Outdated Show resolved Hide resolved
packages/fether-react/src/stores/createAccountStore.js Outdated Show resolved Hide resolved
packages/fether-react/src/stores/createAccountStore.js Outdated Show resolved Hide resolved
packages/fether-react/src/Tokens/Tokens.js Outdated Show resolved Hide resolved
packages/fether-react/src/Tokens/Tokens.js Outdated Show resolved Hide resolved
@Tbaut
Copy link
Collaborator

Tbaut commented Nov 21, 2018

A bit late for a mockup, but what do you think about something like this for the new account:
image

I think it's important to clearly distinguish the 2 types of account recovery/import.

The transition from screen 1 to screen 2 would happen automatically when the user select a file. The "next" button on screen 1 is only useful for recovery with the phrase.

move jsonbackup to its own component/route

lint

lint
@Tbaut
Copy link
Collaborator

Tbaut commented Nov 21, 2018

Also take a look at my proposals to add more menu items at #264

no drop, only browse for file

lint
@Tbaut
Copy link
Collaborator

Tbaut commented Nov 22, 2018

This is looking really good!

I have a similar problem as the one mentioned by Axel. Importing an account that I have gives me a different one at the import. I noticed that the account doesn't have 0x, could that be the culprit?
Edit: the account seems to be the same, but the identicon (blocky) is not.

We should be extra careful I think and ask for a password confirmation. This doesn't make the UX so much worse, and we better make sure the user did not mistype his password.

Also this makes the password screen quite large, I'd rather have a different screen rather than a dropped view, and we can add a little explanation to guide users. Something like: "Choose a password to encrypt Json keystore file".

@Tbaut
Copy link
Collaborator

Tbaut commented Nov 23, 2018

Cool, all my previous comments are solved.

Nit: It'd be nice to accept any sort of file, Parity produces keystore file names without .json and those are not accepted right now unless I specifically add .json.
Also when opening the system's file browser to select a file, can we set it so that it shows any file? Right now it doesn't show anything else than the directories and I have to switch to "any file" to be able to see my .json ones. It requires extra clicks and a novice user might be confused.

I had one weird behavior, when importing an account:

  • I was asked to enter a name (with prefilled name which is great) the enter doesn't allow me to go to the next screen, I have to click the button.
  • but more importantly, on the password screen the enter key is mapped to the back button I guess, so when you think you're done, hit enter but it goes back :)

edit: just realized this is everywhere.. so we might address this in another PR.

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits:

  • the next button should be in the recovery phrase card and centered (see inline comment)
  • focus the "password" field at import and export
  • map the enter key to the "confirm account import" and "backup account" buttons (now on the back)

Otherwise looks great :)

<br />
<Card> {phraseCard} </Card>
<br />
{this.renderButton()}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put the next button in the "phrase card" as it's only relevant to this one, I believe it should be centred as well as are buttons usually.

@Tbaut
Copy link
Collaborator

Tbaut commented Dec 6, 2018

Not sure you expected a review on this yet (simply change the label to "please review" when you think we should have a look)

  • The import function is now broken (gives a different address every time, looks like the JSON is not read properly)
  • The "enter" key is not mapped for the export function.
  • nit (as in "nice to have" if not hard to implement otherwise we can leave it): focus the only available input field (passwords) when getting the screen save a click to users.

@pmespresso
Copy link
Contributor Author

pmespresso commented Dec 7, 2018

@Tbaut, I think it'd be best to make the "focus on password field" a separate PR as it'd involve refactoring the Form Fields as stateful components so we can use React refs etc.

That PR would also fix the current behavior where pressing Enter maps to the Back button in a much simpler way than the past couple commits which detects the keyPress events and keyCodes per form, blabla... but doesn't relate to json import particularly. I will raise this as a separate issue and PR.

@Tbaut
Copy link
Collaborator

Tbaut commented Dec 7, 2018

I'm fine with that.
I just tested it and had a problem to import the account, it wouldn't let me pass this screen (with the right password)

image

@ddorgan
Copy link
Contributor

ddorgan commented Dec 12, 2018

[clabot:check]

@parity-cla-bot
Copy link
Collaborator

It looks like @yjkimjunior hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io

Once you've signed, please reply to this thread with [clabot:check] to prove it.

Many thanks,

Parity Technologies CLA Bot

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My local branch was running crazy, I did a complete test:

  • recovery from phrase
  • export from account
  • import account (previously exported)

all works well, thank you so much :)

@amaury1093
Copy link
Collaborator

@yjkimjunior Can you rebase/merge lastest master?

@axelchalon axelchalon merged commit 844c657 into master Dec 12, 2018
@amaury1093 amaury1093 deleted the yj-json-keyfile branch December 12, 2018 14:40
@pmespresso
Copy link
Contributor Author

[clabot:check]

@parity-cla-bot
Copy link
Collaborator

It looks like @yjkimjunior signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants