amark / gun

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

user.get('newkey').get('newkey').put({}) causes an error #683

Open mmalmi opened 5 years ago

mmalmi commented 5 years ago

Code:

Gun = require('gun');
g = new Gun();
p = Gun.SEA.pair().then(p => {
  user = g.user();
  user.auth(p);
  user.get('newkey').get('newkey').put({});
});

Output:

Hello wonderful person! :) Thanks for using GUN, feel free to ask for help on https://gitter.im/amark/gun and ask StackOverflow questions tagged with 'gun'!
TypeError: Cannot read property 'byteLength' of undefined
    at Function.from (/Users/martti/workspace-old/identifi-lib/node_modules/gun/sea.js:121:34)
    at Object.SEA.opt.fall_verify (/Users/martti/workspace-old/identifi-lib/node_modules/gun/sea.js:470:27)
    at <anonymous>
NO! Mismatched owner on 'newkey'. { 'jqqd9v94jUWKkqrwWhvk~CKCKEuLWon1c_gshn59hBp-grIGxM9NwzWaAXij_Q3M.lkmHiMDqpQbBTYToI6hNbwhoH6wOKw4qZGhW8DqbFuY.':
   { _:
      { '#': 'jqqd9v94jUWKkqrwWhvk~CKCKEuLWon1c_gshn59hBp-grIGxM9NwzWaAXij_Q3M.lkmHiMDqpQbBTYToI6hNbwhoH6wOKw4qZGhW8DqbFuY.',
        '>': [Object] },
     newkey:
      { '#': 'jqqd9v90l6Vl9Z2nFRct~CKCKEuLWon1c_gshn59hBp-grIGxM9NwzWaAXij_Q3M.lkmHiMDqpQbBTYToI6hNbwhoH6wOKw4qZGhW8DqbFuY.' } } }

.put({}) causes the error, while .put({a:1}) doesn't.

GUN version 0.9.999997

mmalmi commented 5 years ago

Also does not occur if GUN is initialized with { radisk: false }.