gun icon indicating copy to clipboard operation
gun copied to clipboard

gun.get('foo').get('bar').put(sea key) store sea key bug

Open Lightnet opened this issue 5 years ago • 9 comments

Bug found I guess.

gun.get('foo').get('bar').put(sea key)

This code should but it need to string to work. As for user.get('foo').put(sea key). Which works without need string but json format.

gun.get('foo').get('bar').once()

Will return null or stop working. Notice by amark.

Lightnet avatar Jul 30 '19 00:07 Lightnet

@Lightnet thanks for the report. I think I also saw this with @QVDev the other day when trying to encrypt video frames. Will need to get this fixed.

amark avatar Aug 27 '19 22:08 amark

👍

On Wed, Aug 28, 2019, 12:08 AM Mark Nadal [email protected] wrote:

@Lightnet https://github.com/Lightnet thanks for the report. I think I also saw this with @QVDev https://github.com/QVDev the other day when trying to encrypt video frames. Will need to get this fixed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/amark/gun/issues/783?email_source=notifications&email_token=AAJTIPK4AIUCPQZ6Y3RSEYTQGWQWDA5CNFSM4IHXF4CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5JIO6A#issuecomment-525502328, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJTIPLRR5FNSLUXSPOAYGDQGWQWDANCNFSM4IHXF4CA .

QVDev avatar Aug 28 '19 04:08 QVDev

people terribly working around this by saving .put('a'+enc) then on a read, doing enc = enc.slice(1) this is a terrible bug that needs to be fixed, I'm just hammered dealing with HackerNoon etc. (which is public data, not encrypted/private). LOVE IT IF SOMEBODY COULD FIX.

amark avatar Jan 09 '20 21:01 amark

I just did ).put(JSON.stringify(value)) and it works as long as you JSON.parse on subsequent gets . That way you can put anything in including an Object and it'll just work around this and any other potential string parsing issues. If you are paranoid base64 encoded after JSON.stringify()

I do this with lots of databases for similar reasons.

pszabop avatar Jan 10 '20 00:01 pszabop

Is this two year old that @amark called 'terrible' still open?

ericvrp avatar Feb 18 '22 15:02 ericvrp

Is this the workaround mentioned by @pszabop? https://github.com/amark/gun/blob/d53d157f19ed6d481f8d3fc3517fff184972140d/examples/basic/private.html#L83-L92

10thfloor avatar Feb 21 '22 18:02 10thfloor