I found this behavior while testing the certificate feature of SEA where the 2nd call of put seemingly never get call. I suspect that the put method mutated the input option to compute something and did not clean that up afterward.
Reproducible Example:
const alice = await SEA.pair();
const cert = await SEA.certify('*', 'foo', alice);
const options = {opt: { cert }} // <-- The important part
const foo = gun.get(`~${alice.pub}`).get('foo');
gun.user().auth(alice, () => {
// callback1 will be called
foo.put('test #1', callback1, options);
// however, callback2 will never be called.
foo.put('test #2', callback2, options);
});
you can inline options and it will behaved as expected
// Both will be called
foo.put('test #1', callback1, {opt: { cert }});
foo.put('test #2', callback2, {opt: { cert }});
gun:
0.2020.1235
environment:browser
,chrome
I found this behavior while testing the certificate feature of SEA where the 2nd call of
put
seemingly never get call. I suspect that theput
method mutated the input option to compute something and did not clean that up afterward.Reproducible Example:
you can inline
options
and it will behaved as expected