Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on running firehose sample #10

Closed
TimBurga opened this issue Jan 1, 2024 · 3 comments
Closed

Exception on running firehose sample #10

TimBurga opened this issue Jan 1, 2024 · 3 comments
Labels
good first issue Good for newcomers

Comments

@TimBurga
Copy link

TimBurga commented Jan 1, 2024

Unfortunately it looks like it may be a race condition in the 3rd party library

System.ArgumentException: The IPFS codec name 'codec-1' is already defined.
   at Ipfs.Registry.Codec.Register(String name, Int32 code)
   at Ipfs.MultiCodec.ReadMultiCodec(Stream stream)
   at Ipfs.Cid.Read(Byte[] buffer)
   at FishyFlip.Tools.Cbor.CborExtensions.ToCid(CBORObject obj)
@drasticactions
Copy link
Owner

It's known, you can ignore it. It doesn't break the underlying code.

@drasticactions drasticactions added the good first issue Good for newcomers label Jan 2, 2024
@drasticactions
Copy link
Owner

For now, we can handle it by outputting the error to the logger so the rest of the object can come through, and you can still act on the error by passing in an ILogger to the underlying Firehose class.

1c280a3

Since Cid is nullable, your code should already be handling cases where it could be null. I would need to look further if there's something I'm missing by not registering the types in advance, or if it is a race condition in the Ipfs library.

@drasticactions
Copy link
Owner

This should be fixed with #167 and the bump to the newest Peter.CBOR library in the last few releases. If it still happens in this release or up, feel free to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants