You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an issue where subsequent calls to put break if a wrong certificate is passed in. The issue is observed when there's a delay between calls, causing both node.put and user.put to silently fail.
Steps to Reproduce
Setup an authenticated user with gun.user().
Generate a new key pair with SEA.pair().
Get a node from the pub-key of the pair.
Pass in a wrong certificate to node.put.
Wait for one second.
Call user.put.
Expected result
Passing in a wrong certificate should yield an error in the ack for node.put.
Calling user.put should put data on the graph.
Actual result
Passing in a wrong certificate silently fails for node.put.
Calling user.put silently fails.
Noteworthy
Removing the delay makes the call to user.put work.
(async()=>{// ... user is an authenticated gun.user().constpair1=awaitSEA.pair();constnode=gun.get(`~${pair1.pub}`);node.get("public").map().once(res=>console.log(res));user.get("public").map().once(res=>console.log(res));constoptions={opt: {cert: "this-is-not-a-valid-certificate"}};node.get("public").get("item").put("node says hello",(ack)=>{console.log(ack);},options);console.log(options);// this is mutated btw.awaitdelay();// wait for one second.user.get("public").get("item").put("user says hello",(ack)=>{console.log(ack)});})();
The text was updated successfully, but these errors were encountered:
Thanks for finding this and making an excellent issue + code to add to tests. IDK my timing to get to it, but if you want to help I can do a video call to get you started on debugging (DM me).
Description
I've encountered an issue where subsequent calls to
put
break if a wrong certificate is passed in. The issue is observed when there's a delay between calls, causing bothnode.put
anduser.put
to silently fail.Steps to Reproduce
gun.user()
.SEA.pair()
.node.put
.user.put
.Expected result
node.put
.user.put
should put data on the graph.Actual result
node.put
.user.put
silently fails.Noteworthy
user.put
work.options
object is mutated. This has been discussed before in:gun.put(data, cb, opt) should not mutate opt #1048
Gun mutates cert object #1093
Example code:
The text was updated successfully, but these errors were encountered: