Skip to content

Commit 5fab09e

Browse files
authored
fix: Rename IJsonSerializable, Hint, and Attachment (#3116)
1 parent 4f526f7 commit 5fab09e

File tree

97 files changed

+562
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+562
-559
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
### Fixes
66

77
- To resolve conflicting types due to the SDK adding itself to the global usings:
8-
- The interface `Sentry.ISession` has been renamed to `Sentry.ISentrySession`
8+
- The interface `Sentry.ISession` has been renamed to `Sentry.ISentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
9+
- The interface `Sentry.IJsonSerializable` has been renamed to `Sentry.ISentryJsonSerializable` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
910
- The class `Sentry.Session` has been renamed to `Sentry.SentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
11+
- The class `Sentry.Attachment` has been renamed to `Sentry.SentryAttachment` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
12+
- The class `Sentry.Hint` has been renamed to `Sentry.SentryHint` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
1013

1114
### Dependencies
1215

samples/Sentry.Samples.Console.Customized/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ await SentrySdk.ConfigureScopeAsync(async scope =>
110110

111111
SentrySdk.AddBreadcrumb(
112112
new Breadcrumb("A breadcrumb that will be replaced by the 'BeforeBreadcrumb callback because of the hint", null),
113-
new Hint("don't trust this breadcrumb", "trust this instead")
113+
new SentryHint("don't trust this breadcrumb", "trust this instead")
114114
);
115115

116116
// Data added to the root scope (no PushScope called up to this point)

src/Sentry.Maui/Internal/ScreenshotAttachment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Sentry.Maui.Internal;
44

5-
internal class ScreenshotAttachment : Attachment
5+
internal class ScreenshotAttachment : SentryAttachment
66
{
77
public ScreenshotAttachment(SentryMauiOptions options)
88
: this(

src/Sentry.Maui/Internal/SentryMauiScreenshotProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public SentryMauiScreenshotProcessor(SentryMauiOptions options)
1616
return @event;
1717
}
1818

19-
public SentryEvent? Process(SentryEvent @event, Hint hint)
19+
public SentryEvent? Process(SentryEvent @event, SentryHint hint)
2020
{
2121
hint.Attachments.Add(new ScreenshotAttachment(_options));
2222
return @event;

src/Sentry/Breadcrumb.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Sentry;
88
/// Series of application events.
99
/// </summary>
1010
[DebuggerDisplay("Message: {" + nameof(Message) + "}, Type: {" + nameof(Type) + "}")]
11-
public sealed class Breadcrumb : IJsonSerializable
11+
public sealed class Breadcrumb : ISentryJsonSerializable
1212
{
1313
private readonly IReadOnlyDictionary<string, string>? _data;
1414
private readonly string? _message;

src/Sentry/Contexts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Sentry;
1111
/// Represents Sentry's structured Context.
1212
/// </summary>
1313
/// <seealso href="https://develop.sentry.dev/sdk/event-payloads/contexts/" />
14-
public sealed class Contexts : IDictionary<string, object>, IJsonSerializable
14+
public sealed class Contexts : IDictionary<string, object>, ISentryJsonSerializable
1515
{
1616
private readonly ConcurrentDictionary<string, object> _innerDictionary = new(StringComparer.Ordinal);
1717

src/Sentry/Extensibility/DisabledHub.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public bool CaptureEnvelope(Envelope envelope)
147147
/// <summary>
148148
/// No-Op.
149149
/// </summary>
150-
public SentryId CaptureEvent(SentryEvent evt, Scope? scope = null, Hint? hint = null) => SentryId.Empty;
150+
public SentryId CaptureEvent(SentryEvent evt, Scope? scope = null, SentryHint? hint = null) => SentryId.Empty;
151151

152152
/// <summary>
153153
/// No-Op.
@@ -157,7 +157,7 @@ public bool CaptureEnvelope(Envelope envelope)
157157
/// <summary>
158158
/// No-Op.
159159
/// </summary>
160-
public SentryId CaptureEvent(SentryEvent evt, Hint? hint, Action<Scope> configureScope) => SentryId.Empty;
160+
public SentryId CaptureEvent(SentryEvent evt, SentryHint? hint, Action<Scope> configureScope) => SentryId.Empty;
161161

162162
/// <summary>
163163
/// No-Op.
@@ -169,7 +169,7 @@ public void CaptureTransaction(SentryTransaction transaction)
169169
/// <summary>
170170
/// No-Op.
171171
/// </summary>
172-
public void CaptureTransaction(SentryTransaction transaction, Scope? scope, Hint? hint)
172+
public void CaptureTransaction(SentryTransaction transaction, Scope? scope, SentryHint? hint)
173173
{
174174
}
175175

src/Sentry/Extensibility/HubAdapter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public SentryId CaptureEvent(SentryEvent evt, Scope? scope)
219219
/// </summary>
220220
[DebuggerStepThrough]
221221
[EditorBrowsable(EditorBrowsableState.Never)]
222-
public SentryId CaptureEvent(SentryEvent evt, Scope? scope, Hint? hint = null)
222+
public SentryId CaptureEvent(SentryEvent evt, Scope? scope, SentryHint? hint = null)
223223
=> SentrySdk.CaptureEvent(evt, scope, hint);
224224

225225
/// <summary>
@@ -233,7 +233,7 @@ public SentryId CaptureEvent(SentryEvent evt, Action<Scope> configureScope)
233233
/// <summary>
234234
/// Forwards the call to <see cref="SentrySdk"/>.
235235
/// </summary>
236-
public SentryId CaptureEvent(SentryEvent evt, Hint? hint, Action<Scope> configureScope)
236+
public SentryId CaptureEvent(SentryEvent evt, SentryHint? hint, Action<Scope> configureScope)
237237
=> SentrySdk.CaptureEvent(evt, hint, configureScope);
238238

239239
/// <summary>
@@ -256,7 +256,7 @@ public void CaptureTransaction(SentryTransaction transaction)
256256
/// </summary>
257257
[DebuggerStepThrough]
258258
[EditorBrowsable(EditorBrowsableState.Never)]
259-
public void CaptureTransaction(SentryTransaction transaction, Scope? scope, Hint? hint)
259+
public void CaptureTransaction(SentryTransaction transaction, Scope? scope, SentryHint? hint)
260260
=> SentrySdk.CaptureTransaction(transaction, scope, hint);
261261

262262
/// <summary>

src/Sentry/Extensibility/ISentryEventProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface ISentryEventProcessor
2020

2121
internal static class ISentryEventProcessorExtensions
2222
{
23-
internal static SentryEvent? DoProcessEvent(this ISentryEventProcessor processor, SentryEvent @event, Hint hint)
23+
internal static SentryEvent? DoProcessEvent(this ISentryEventProcessor processor, SentryEvent @event, SentryHint hint)
2424
{
2525
return (processor is ISentryEventProcessorWithHint contextualProcessor)
2626
? contextualProcessor.Process(@event, hint)

src/Sentry/Extensibility/ISentryEventProcessorWithHint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ public interface ISentryEventProcessorWithHint : ISentryEventProcessor
99
/// Process the <see cref="SentryEvent"/>
1010
/// </summary>
1111
/// <param name="event">The event to process</param>
12-
/// <param name="hint">A <see cref="Hint"/> with context that may be useful prior to sending the event</param>
12+
/// <param name="hint">A <see cref="SentryHint"/> with context that may be useful prior to sending the event</param>
1313
/// <return>The processed event or <c>null</c> if the event was dropped.</return>
1414
/// <remarks>
1515
/// The event returned can be the same instance received or a new one.
1616
/// Returning null will stop the processing pipeline so that the event will neither be processed by
1717
/// additional event processors or sent to Sentry.
1818
/// </remarks>
19-
SentryEvent? Process(SentryEvent @event, Hint hint);
19+
SentryEvent? Process(SentryEvent @event, SentryHint hint);
2020
}
2121

0 commit comments

Comments
 (0)