ssbc / ssb-ref

check if a string is a valid ssb-reference
MIT License
14 stars 10 forks source link

catch throw when decoding malformed multserver-address's #44

Closed austinfrey closed 3 years ago

austinfrey commented 3 years ago

I think this is all that's needed to fix https://github.com/ssb-js/ssb-ref/issues/39 and also https://github.com/fraction/oasis/issues/418.

Not sure if printing the error is what is best or if something more quiet would be better?

austinfrey commented 3 years ago

@christianbundy is this what you had in mind for this fix or are there some ways to enhance it?

mixmix commented 3 years ago

This could be the behavior. But then I think we should explicitly return undefined or null.

I think this will still cause problems in ssb-invite though. You'll need to see where this function call is in there and then see what it next tries to do with undefined

mixmix commented 3 years ago

Seems good to me. It would be sweet if one other butt also familiar with the back end could give this a quick glance. I summon @arj03

(Otherwise let's merge and publish and it can be your responsibility to help listen for it problems emerge)

arj03 commented 3 years ago

Thanks for the fix @austinfrey! :-)