amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
18.05k stars 1.16k forks source link

user.delete() does not delete the user #1229

Closed resession closed 2 years ago

resession commented 2 years ago

after creating a user, i try tod elete that user. but gun does not delete the user.

this is the code i tested

user.create('19testuser', 'passtest19', data => { user.auth('19testuser', 'passtest19', data => { const test = {alias: '19testuser', pub: [data.pub](http://data.pub/)} user.leave() user.delete('19testuser', 'passtest19', data => { console.log('deleted', data) gun.get('~@' + test.alias).once(data => { console.log('alias', data) gun.get('~' + [test.pub](http://test.pub/)).once(data => { console.log('pub', data) }) }) }) }) })

this is what is logged

deleted { ok: 0 } alias { _: { '#': '~@19testuser', '>': { '~5EAwi8GBq--4sEju5F216bsd0WVDpBPH0Kh0blaq_2w.lhL2VFlvvUPUnJNwgDRSLKYw1RwIN968ET9y3rLygfU': 1649207683500 } }, '~5EAwi8GBq--4sEju5F216bsd0WVDpBPH0Kh0blaq_2w.lhL2VFlvvUPUnJNwgDRSLKYw1RwIN968ET9y3rLygfU': { '#': '~5EAwi8GBq--4sEju5F216bsd0WVDpBPH0Kh0blaq_2w.lhL2VFlvvUPUnJNwgDRSLKYw1RwIN968ET9y3rLygfU' } } pub undefined

so that means .get('~pub') returns undefined, but .get('~@alias') still returns the user data even though it should have been deleted

resession commented 2 years ago

closing