jolocom / smartwallet-app

A decentralized self sovereign identity solution developed by Jolocom.
https://jolocom.io
Other
80 stars 38 forks source link

undefined is not an object (evaluating 'interaction.getMessages()[0].interactionToken') #1698

Closed ndileep-dev closed 3 years ago

ndileep-dev commented 3 years ago

undefined is not an object (evaluating 'interaction.getMessages()[0].interactionToken')

This is the issue i am getting while scanning the QR code.

SBub commented 3 years ago

@ndileep-dev thank you for submitting the issue We just updated the issue template to be able to get insights what might have gone wrong. In the future please follow the issue template

Please specify:

Seems like there was no request interaction token stored in the db, did you forgot to processJWT (it is automatically done for you, when you scan QR code, or paste JWT: Settings -> Paste Interaction Token) ?

ndileep-dev commented 3 years ago

@SBub thank you for the information

FYI Smart wallet :1.11.0 QR code scanned: https://avalon.jolocom.com/

Error: "TypeError: interaction.getAttributesByType is not a function. (In 'interaction.getAttributesByType(t)', 'interaction.getAttributesByType' is undefined)"

line no 38 in consumeInteractionToken.ts

await sdk.findInteraction(jwt). is throwing error

and some times while keep on trying, i am getting the follow listed error

{ [Error: InvalidToken] origError: { [Error: IDWTokenExpired] line: 280261, column: 32, sourceURL: 'http://localhost:8081/index.bundle?platform=android&dev=true&minify=false' }, line: 7312, column: 64, sourceURL: 'http://localhost:8081/index.bundle?platform=android&dev=true&minify=false' }

Thanks in advance.

SBub commented 3 years ago

@ndileep-dev SmartWallet 1.x was deprecated yesterday, we no longer support it, meanwhile sdk was updated too. Please use SmartWallet 2.x to see the most updated version with correct dependencies.

You can test SW2.x with Avalon, however, if you want to test ~full~ capabilities of SW2.x use dev interaction demo https://interxns.jolocom.io

clauxx commented 3 years ago

@ndileep-dev We could not reproduce the issue you submitted on both the 1.11.0 and 1.11.1 versions (based on the tags). BTW, which version of the @jolocom/sdk do you have installed? Nevertheless, the second error you mentioned (IDWTokenExpired) is caused by the fact that the JWTs we use for the interaction messages expire within an hour.

ndileep-dev commented 3 years ago

@SBub @clauxx Thanks for your response. After locking the version of the react-native-jolocom package to 2.2.0, my issue got resolved.

FYI my yarn.lock: react-native-jolocom@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/react-native-jolocom/-/react-native-jolocom-2.2.0.tgz#22ba4c7d2e8b7ecb80d3afe81afb57773fe05d90"

Thanks, Dileep N