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

Obsolete unnecessary APIs

Open mattjohnsonpint opened this issue 3 years ago • 3 comments
trafficstars

This issue will keep track of APIs that we want to remove in the next major release (4.0.0). Will keep this open and update as we find them. See https://github.com/getsentry/sentry-dotnet/blob/main/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt for list from the main Sentry project.

mattjohnsonpint avatar Apr 21 '22 21:04 mattjohnsonpint

Does scope.Platform qualify? https://github.com/getsentry/sentry-dotnet/issues/1590

bitsandfoxes avatar Apr 25 '22 15:04 bitsandfoxes

Does scope.Platform qualify? #1590

Yes, I think so.

mattjohnsonpint avatar Sep 19 '22 14:09 mattjohnsonpint

Another - Contexts didn't need to inherit from ConcurrentDictionary<string, object>. It would be better to inherit from IDictionary<string, object> instead, and encapsulate it instead. See comments : https://github.com/getsentry/sentry-dotnet/issues/1332#issuecomment-1251080640

mattjohnsonpint avatar Sep 19 '22 15:09 mattjohnsonpint

Other good candidates: WIthScope API. It was reverted from being marked obsolete due to what I believe was a misunderstanding, since it's broken on global mode. And a new one with async was introduced, Another one worth considering making obsolete is the original; ConfigureScopeAsync, but this is less obvious:

That's because the SDK avoid calling callbacks if disabled as an optimization. While people put their core business logic inside our callbacks. So the async call can be spared if the sole reason to run it is to fetch data to set to the scope. But WithScope has logic that happens inside and folks expect to always run regardless of Sentry being configured.

Local scope works in global mode and local mode and is advised instead.

bruno-garcia avatar Sep 16 '23 01:09 bruno-garcia

We now have separate issues for each of the items mentioned here and we already have the feat/4.0.0 pull request as an umbrella to sit across these (plus all the others)... so closing this issue as redundant.

jamescrosswell avatar Oct 11 '23 21:10 jamescrosswell