EventStore / EventStore-Client-Dotnet

Dotnet Client SDK for the Event Store gRPC Client API written in C#
Other
138 stars 38 forks source link

FirstChanceException when no metadata #310

Closed StevenBlair123 closed 1 month ago

StevenBlair123 commented 1 month ago

Describe the bug If an event has no metadata, or one of the followign properties missing $traceId | $spanId the method ExtractTracingMetadata throws an Exception. It is handled silently, so the Event isn't rejected, but means each Event being processed has an Exception thrown for it.

To Reproduce

Replicated code

Steps to reproduce the behavior:

  1. Hookup AppDomain.CurrentDomain.FirstChanceException
  2. Write an event with no metadata
  3. Persistent subscription to newly created stream
  4. Observe the FirstChanceException being thrown

Expected behavior

I think we should check if the proeprties are present in the metadata, and if not, cleanly return the TracingMetadata.None.

Actual behavior Exception is thrown, silently handled and TracingMetadata.None returned.

Config/Logs/Screenshots If applicable, please attach your node configuration, logs or any screenshots.

EventStore details

Additional context None at this time.

josephcummings commented 1 month ago

Hi @StevenBlair123

Thanks for bringing this to our attention.

I have prepared a fix in #311 and will get it out as patch v23.3.3 once merged.

StevenBlair123 commented 1 month ago

Thanks for the quick turnaround.

josephcummings commented 1 month ago

Hi @StevenBlair123

Patch v23.3.3 is now up on NuGet :)