edge / wallet

The web wallet of the XE Blockchain.

Home Page:https://wallet.xe.network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unlock Wallet not working on enter

willgarrett64 opened this issue · comments

When locking and then unlocking a wallet, there is a error when you try to unlock on enter (rather than clicking the button).

What's strange is:

  • if you unlock on enter, it means that unlocking on button click no longer works either (you have to refresh the page to "reset" it so that unlock on click works again)
  • if you unlock on button click, subsequently unlocking on enter will work
index.js:311 Uncaught (in promise) TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
    at g (index.js:311:9)
    at c (index.js:137:10)
    at Function.u.from (index.js:149:10)
    at i (crypto.js:41:70)
    at v0.js:34:10
    at c (runtime.js:63:40)
    at Generator._invoke (runtime.js:294:22)
    at Generator.next (runtime.js:119:21)
    at n (asyncToGenerator.js:3:20)
    at s (asyncToGenerator.js:25:9)

image

commented

The original characterisation of this issue wasn't completely accurate: I was able to reproduce this bug by creating/restoring a wallet, immediately locking it, and then attempting to unlock it again. The behaviour was the same whether pressing enter or clicking the Unlock button.

The problem was that the wallet version was not updated in Vuex without reloading the page, so storage would fall back to an older version (i.e. 0) and mishandle the wallet public key, attempting to access the .iv property of a string. Since undefined property access doesn't cause an error, it would then pass undefined to the decryption layer while trying to update the wallet (which is expected to happen on every unlock, don't worry) thereby producing this error.

This is now fixed in 7d52e5e by reloading the wallet after create/restore.