Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

ID without username causes exception #61

Open
talhasch opened this issue Nov 23, 2019 · 4 comments
Open

ID without username causes exception #61

talhasch opened this issue Nov 23, 2019 · 4 comments
Assignees

Comments

@talhasch
Copy link

User.createWithCurrentUser() causes group-membership.js:190 Uncaught (in promise) TypeError: Cannot read property 'attrs' of undefined with non-username accounts.

Ekran Resmi 2019-11-23 15 25 06

Ekran Resmi 2019-11-23 15 27 15

Tested versions: 0.2.1, 0.3.0-beta.1

@talhasch talhasch changed the title Uncaught (in promise) TypeError Uncaught (in promise) TypeError: Cannot read property 'attrs' of undefined Nov 23, 2019
@hdriqi
Copy link

hdriqi commented Nov 26, 2019

Yap also occurs on previous version and this is really important to fix, because user that are login using the recovery do not have their username in the first place

@moxiegirl
Copy link

moxiegirl commented Dec 5, 2019

@talhasch This type of error usually happens when the user is not signed in correctly, or the user is not available in radiks models, try to use User.createWithCurrentUser(); before the user start his session or logging in. Hank did an illustration of how to do this here: made the fix in the stackit sample which others can see here stacks-archive/stackit#8

@talhasch
Copy link
Author

talhasch commented Dec 6, 2019

@moxiegirl see https://github.com/blockstack/radiks/blob/master/src/models/group-membership.ts#L52

if the account doesn't have a username radiks creates _id field with an uuid and right after queries with the account's username (null) Since no match on server side that error occurs.

radiks highly rely on username but not all accounts have username.

i think identityAddress is more appropriate for _id field. It is unique and all accounts have it.

we have 1463 users on runkod so far but 303 of them (almost 1/4) couldn't login due to that problem. Even a TMUI tester couldn't login and runkod got very weak score.

@moxiegirl
Copy link

@talhasch Thanks for clarifying the issue. @jeffdomke I'm going to drop this back into the queue. The code does not handle the usecase where an id has no username. Need to decide if this is a feature request a bug. May also be something we need to simply have a better error for.

@moxiegirl moxiegirl changed the title Uncaught (in promise) TypeError: Cannot read property 'attrs' of undefined ID without username causes exception Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants