sentry-dotnet icon indicating copy to clipboard operation
sentry-dotnet copied to clipboard

Replace Device.Timezone property

Open jamescrosswell opened this issue 2 years ago • 8 comments

There's currently a TODO item in Sentry.Protocol.Device added by Alexey here.

https://github.com/getsentry/sentry-dotnet/blob/e75d537c14ded617c99eb33f19cf4ce69ca4de36/src/Sentry/Protocol/Device.cs#L18-L26

A serialize -> deserialize can theoretically lose some information at the moment. See: https://github.com/getsentry/sentry-dotnet/blob/e6c1d6491a7b2af9f1d0e1d0944b33778cb3b8fe/test/Sentry.Tests/Protocol/Context/DeviceTests.cs#L199-L243

This is likely only a problem with custom time zones. We haven't yet bumped into anyone using these. So we agreed not to address this until/unless it becomes a problem for one of our customers.

jamescrosswell avatar Sep 26 '23 09:09 jamescrosswell

I believe he's talking about deserialization. If we serialize->deserialize->serialize again (happens when offline mode is turn on where we go to disk then back to memory then to the network).

Does it work then?

bruno-garcia avatar Nov 06 '23 20:11 bruno-garcia

I believe he's talking about deserialization. If we serialize->deserialize->serialize again (happens when offline mode is turn on where we go to disk then back to memory then to the network).

Does it work then?

OK, that's a bit more concrete. That gives us something to test then.

jamescrosswell avatar Nov 07 '23 07:11 jamescrosswell

Although, as this seems to be coming through to Sentry.io just fine at the moment, I'm not sure why we'd change it (if it ain't broke, don't fix it).

Let's move out of the 4.0.0 milestone then?

vaind avatar Nov 08 '23 11:11 vaind

5.0

bruno-garcia avatar Nov 08 '23 19:11 bruno-garcia

I believe he's talking about deserialization. If we serialize->deserialize->serialize again (happens when offline mode is turn on where we go to disk then back to memory then to the network).

In theory, even just a serialize -> deserialize will lose some information at the moment. See: https://github.com/getsentry/sentry-dotnet/blob/e6c1d6491a7b2af9f1d0e1d0944b33778cb3b8fe/test/Sentry.Tests/Protocol/Context/DeviceTests.cs#L199-L243

As far as I can tell, this would only be a problem with custom time zones, however... so whilst it's a theoretical problem, I'm not sure how likely it is that it would ever be an actual problem that one of our SDK customers runs into. Do we know of anyone, ever, who needed to use a custom time zone for some reason?

I'd suggest postponing this until we had at least one SDK customer asking for it.

jamescrosswell avatar Aug 27 '24 00:08 jamescrosswell

I'd suggest postponing this until we had at least one SDK customer asking for it.

I agree. This looks to me like a very specific optimization. I'll remove it from the 5.0 milestone and drop the priority.

bitsandfoxes avatar Sep 03 '24 14:09 bitsandfoxes

As is and with the scope of the changes needed, I'd suggest removing the TODO from the code (it will be kept here because of the permalink in the issue description so it's not lost) and closing the issue.

vaind avatar Sep 03 '24 17:09 vaind

I'd suggest removing the TODO from the code

Done. Only 522 todo items to go!

jamescrosswell avatar Sep 03 '24 21:09 jamescrosswell