gun icon indicating copy to clipboard operation
gun copied to clipboard

SEA Certificate with Blacklist make put silently fail, and callback not called

Open yokowasis opened this issue 2 years ago • 8 comments

Code

const Gun = require("gun");
require('gun/sea');

const gun = Gun();

(async()=>{
    const user1Pair = await Gun.SEA.pair();
    const user2Pair = await Gun.SEA.pair();
    
    const cert = await Gun.SEA.certify("*",{"*" : "chat-with"},user1Pair,null,{
        blacklist : 'blacklist' //if you delete this line, it works fine. 
    });

    gun.user().auth(user2Pair,cb=>{
        gun.get(`~${user1Pair.pub}`).get("chat-with").put({
            "hello" : "world"
        },ack=>{
            console.log (ack);
        },{
            opt : {
                cert : cert
            }
        })    
    })
})()

yokowasis avatar Sep 29 '21 09:09 yokowasis

This is most likely due to blaclist being renamed to block.

https://github.com/amark/gun/commit/63b0043076e4d49a49279fdd245b2df300cdbea2

abow avatar Sep 29 '21 12:09 abow

I also just noticed that block is currently not working.

That commit has tbe note: The "block" (former "blacklist") feature is not working yet (due to a bug in gun)

abow avatar Sep 29 '21 12:09 abow

@mimiza is this waiting for me?

(heads up: I'm gonna be gone the next 2 weeks, just FYI to people)

amark avatar Sep 30 '21 00:09 amark

@amark Yes. It's waiting for you.

This issue has been reported at #1137

mimiza avatar Sep 30 '21 01:09 mimiza

Oh thank you! Apologies, I just saw that and though "d'oh!", thank you.

amark avatar Sep 30 '21 01:09 amark

@mimiza @amark should we correct the docs to use 'block' instead of 'blacklist' already? Or do we need the fix to be published to NPM first?

davay42 avatar Feb 05 '22 21:02 davay42

@mimiza @amark should we correct the docs to use 'block' instead of 'blacklist' already? Or do we need the fix to be published to NPM first?

Hi. Some weeks ago, Mark and I discussed about this feature and we think it should be deprecated. So there will be no such feature in the future. Davay I think you could add something like "TO BE DEPRECATED" to the doc.

mimiza avatar Feb 07 '22 04:02 mimiza

Yeah, I got the idea on removing non-O(1) requests from the chain. I'll take my time to remove the blacklist from examples.

davay42 avatar Feb 07 '22 10:02 davay42