gun icon indicating copy to clipboard operation
gun copied to clipboard

[Bug?] wrong key path in error message

Open rozek opened this issue 2 years ago • 1 comments

when trying

  const sharedData = Gun.get('sharingTest').get('sharedData')

  const TestObject = {
    'null':       null,
    'boolean':    true,
    'number':     1.23,
    'string':     'Hi',
    'object':     { 'null':null, 'boolean':false, 'number':1.23, 'string':'Hi' },
message:undefined,
  }

  sharedData.put(TestObject)

I get the following error message on the browser console:

Invalid data: undefined at sharingTest.sharedData.boolean.message

While I understand the reason, I do not understand the given location: where does ".boolean" come from?

rozek avatar May 14 '23 07:05 rozek

@rozek you're correct, not sure why that happened :( its roughly ~L1040 which uses the chain.back function to loop up the chain which is rouglhy at ~L558. Probably would take me a while to debug myself honestly, and this is low priority, but would love if people gave it a stab! Maybe with like what you have here added as a test.

amark avatar May 21 '23 04:05 amark