-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
Event timestamp serialization from JSON #3108
Comments
There might be something to fix here but to to clarify: An envelope and an event are different things. Envelopes contain items, and one of those could be an event. What are you trying to accomplish? we might be able to help you differently |
Hi, I'm just trying to deserialize an complete received envelope, which fails if it contains an event with a timestamp formatted as a number. When te timestamp is formatted as a string everything works as expected. I do see in the code (or so it seems) that timestamps as numbers are not supported, but that should be supported as even the sentry-cli sends such events. |
Happy to help but I'm not quite following how to reproduce the issue you're running into: |
I'm forwarding messages to Sentry, that's how I get the messages. I'll create a small test for you to see what's happening |
this is a simple unit test to recreate the issue see https://develop.sentry.dev/sdk/event-payloads/ where it is explained that the timestamp can be either a string or a number |
I see. Yeah, we rely on |
I think we're looking for something like
instead of sentry-dotnet/src/Sentry/SentryEvent.cs Line 293 in ee3ea36
@arend-melissant-tnt, would you be willing to open a PR for this? |
I'm having this issue in the latest version, any idea when this will be fixed? |
Referencing #2102 - close this issue with that issue |
@aritchie if it helps this is the involved JSON
|
Package
Sentry
.NET Flavor
.NET
.NET Version
8.0
OS
Any (not platform specific)
SDK Version
4.0.0
Self-Hosted Sentry Version
No response
Steps to Reproduce
read envelope from incoming message (using sentry-cli send-event)
deserialize envelope using var envelope = await Envelope.DeserializeAsync(stream);
this will throw an exception: The requested operation requires an element of type 'String', but the target element has type 'Number'.
this is an the "timestamp" element of the event payload
Expected Result
timestamp should deserialize with either a string or number (per SDK)
Actual Result
Exception thrown
The text was updated successfully, but these errors were encountered: