Skip to content
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

fix: #426 (Payload Details When Signing Hash), #427 (Multipart Missed Frames) #428

Merged
merged 26 commits into from
Oct 30, 2019

Conversation

pmespresso
Copy link
Contributor

@pmespresso pmespresso commented Oct 21, 2019

-- on Signer

@pmespresso pmespresso marked this pull request as ready for review October 21, 2019 15:38
@pmespresso pmespresso changed the title Multipart part 2 (mostly UX, non-core functionality) Fix: #426 (Payload Details When Signing Hash), #427 (Multipart Missed Frames) Oct 21, 2019
@Tbaut Tbaut changed the title Fix: #426 (Payload Details When Signing Hash), #427 (Multipart Missed Frames) fix: #426 (Payload Details When Signing Hash), #427 (Multipart Missed Frames) Oct 22, 2019
Copy link
Contributor

@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.

Signing multipart works well.. as long as the QR codes are in order/can be read.
I found 2 problems (the second is not new):

  1. I have 3 QR codes that seem to be the 3/13, the 10/13 and the 13/13. I will cycle though them manually.
  • Scanning the 3/13 is fine
  • then the 10/13 it shows that I missed 4,5,6,7,8,9 fine
  • then scanning 13/13 shows that I missed 4,5,6,7,8,9,11,12 fine
  • then back to the 3/13 it erroneously removed the 4 from the missed list
  • then back the 10/13 it erroneously removed the 11 from the missed list
    So the missed frame count is off by one after one round.
  • video (real device mirrored): https://youtu.be/kEPZe1uR7FM
  1. I've been able to leave the Signer in a weird state so that clicking on "scan" from the account list directly shows me a multipart advancement.
  • let's start from scratch, I click on "start over".. and keep pointing at this 3/13 QR code
  • scan the 3/13 fine, move on
  • scanning the 10/13, because I move too much it fires an error "Unable to parse transaction", fine
  • click on "start over" and keep pointing at the 10/13
  • it shows erroneously directly that I've scanned 8/13 frames.
  • video (real device mirrored): https://youtu.be/Hm3KDVyXJFc

My 3 QR codes:

@pmespresso
Copy link
Contributor Author

hey @Tbaut , could you please review again? I can't reproduce the second issue, but I suspect it might have been a side effect of the off by one error, which is fixed now

@pmespresso
Copy link
Contributor Author

ezgif-6-31b82f34c100

@pmespresso
Copy link
Contributor Author

Addressed some final grumbles, tested sudo.system.remark for single and multiframe on Kusama, extrinsic goes through, @hanwencheng @Tbaut, if you are happy with this then let's merge and get a patch release out.

@hanwencheng
Copy link
Contributor

hanwencheng commented Oct 29, 2019

IMG_0040

It seems that the missing part is not shown

Tested functionality with 4 random appeared frame on iOS with sudo system.setRemark

@hanwencheng
Copy link
Contributor

hanwencheng commented Oct 29, 2019

Thanks for the PR! Tested well on iOS.

With discussed with YJ, I was misunderstand the meaning of missedFrames, I thought it is the frames to be scanned, but it actually means the frames was skipped.

I think currently the 1/4 count could perfectly shows the Scanned frames count and Total frames count. It would be nice we could show the the list of frame numbers has not been scanned since gives the information both the missed frames and and the following frames.

I have two following suggestion to be discussed for the further improvement:

  • Move setState(multipartComplete) to the end of the setPartData function, so there is no 10/10 screen and directly jump to the TxDetails screen.
  • Do the if(!multipartComplete && parsedData.isMultipart) cleanup() in componentWillUnmount in the QrScanner, so that when user click cancel the scanning and come back they do not need to click Start Over again.

@pmespresso
Copy link
Contributor Author

pmespresso commented Oct 29, 2019

Thanks for the review, I will log those as UX/UI enhancement requests, to be added on top of this so that this PR can remain in bulk about the core issues. I've addressed the first grumble, the second one is going to be more hairy and require a lot more testing again, so will log that for a near future PR.

Copy link
Contributor

@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.

After a yarn clean; yarn; yarn start as well as a cargo clean

Substrate Dev

Kusama dev

  • transfer shows the right method -> says I've the wrong pin ⚔️
  • system.remark, shows the right method -> says I've the wrong pin ⚔️

Ethereum Kovan

  • Transfer ETH ✔️

I've checked twice each account (Substrate and Kusama, the pin is ok to view the recovery, not for signing anything.)

@pmespresso
Copy link
Contributor Author

@Tbaut I really could not reproduce the "wrong pin" issue, I'm able to sign and send on Kusama and Substrate Dev both no problem. Did you build the Rust code again after cleaning?

Copy link
Contributor

@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.

So after many checks and clean:
✔️ I am able to sign multipart QR codes
✖️ I am not able to sign a single part QR code (bond, remark, transfer were tested), neither is Hanwen on Android

Copy link
Contributor

@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.

Can't believe this dead code could cause so much troubles.. we're almost there!

Tested e2e on Kusama
✔️ Tx
✔️ multipart sudo remark
✔️ phragmentElection
✔️ bond Kusama

on ETH
✔️ ETH transfer
✖️ ETH signging with MyCrypto

image
which leads to this weird screen (it's eth message signing)
image

@pmespresso
Copy link
Contributor Author

on another note, eslint should be catching and pointing out the dead code (of which there is quite a lot from the previous owner).

Copy link
Contributor

@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.

Thank you so much :)

@pmespresso pmespresso merged commit 5c587fd into master Oct 30, 2019
@pmespresso pmespresso deleted the yj-multipart2 branch October 30, 2019 16:58
pmespresso added a commit that referenced this pull request Nov 9, 2019
… Frames) (#428)

* fix: show prehash image along with hash

* fix: lint

* fix: display missed frames by index

* fix: remove from missed frames list once scanned

* fix: edge case for multiple  loops

* fix: multiple loops

* fix: off by one error

* fix: asyn cscanner state clear

* chore: bump @polkadot-js deps

* fix: make tests pass

* fix: qrcodehash

* fix: blake2s -> blake2b

* fix: signing hash

* fix: hash the correct thing ffs

* fix: stray print

* fix: show payload details along with hash

* fix: stray logs

* fix: minor grumble

* make android able to sign single part

* fix: ethereum sign msg

* fix: ethereum sign msg

* fix: undeifned

* fix: prehash optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setCode is showed as a Message signing Enhance Multipart scanning UX
3 participants