Skip to content

Commit 9d1b4fe

Browse files
Removed obsolete v6 APIs (#4619)
1 parent 90a3823 commit 9d1b4fe

24 files changed

+9
-604
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
- `BreadcrumbLevel.Critical` has been renamed to `BreadcrumbLevel.Fatal` for consistency with the other Sentry SDKs ([#4605](https://github.com/getsentry/sentry-dotnet/pull/4605))
88
- SentryOptions.IsEnvironmentUser now defaults to false on MAUI. The means the User.Name will no longer be set, by default, to the name of the device ([#4606](https://github.com/getsentry/sentry-dotnet/pull/4606))
99
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602))
10+
- Removed obsolete APIs ([#4619](https://github.com/getsentry/sentry-dotnet/pull/4619))
11+
- Removed the unusual constructor from `Sentry.Maui.BreadcrumbEvent` that had been marked as obsolete. That constructor expected a `IEnumerable<(string Key, string Value)>[]` argument (i.e. an array of IEnumerable of tuples). If you were using this constructor, you should instead use the alternate constructor that expects just an IEnumerable of tuples: `IEnumerable<(string Key, string Value)>`.
12+
- Removed `SentrySdk.CaptureUserFeedback` and all associated members. Use the newer `SentrySdk.CaptureFeedback` instead.
1013
- Backpressure handling is now enabled by default, meaning that the SDK will monitor system health and reduce the sampling rate of events and transactions when the system is under load. When the system is determined to be healthy again, the sampling rates are returned to their original levels. ([#4615](https://github.com/getsentry/sentry-dotnet/pull/4615))
1114
- ScopeExtensions.Populate is now internal ([#4611](https://github.com/getsentry/sentry-dotnet/pull/4611))
1215

src/Sentry.Maui/BreadcrumbEvent.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,4 @@ public BreadcrumbEvent(
5252
e => new KeyValuePair<string, string>(e.key, e.value)))
5353
{
5454
}
55-
56-
/// <summary>
57-
/// This constructor remains for backward compatibility.
58-
/// </summary>
59-
/// <param name="sender"></param>
60-
/// <param name="eventName"></param>
61-
/// <param name="extraData"></param>
62-
[Obsolete("Use one of the other simpler constructors instead.")]
63-
public BreadcrumbEvent(
64-
object? sender,
65-
string eventName,
66-
IEnumerable<(string Key, string Value)>[] extraData) : this(sender, eventName, extraData.SelectMany(
67-
x => x.Select(pair => new KeyValuePair<string, string>(pair.Key, pair.Value)))
68-
)
69-
{
70-
}
7155
}

src/Sentry/Extensibility/DisabledHub.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,6 @@ public void Dispose()
242242
{
243243
}
244244

245-
/// <summary>
246-
/// No-Op.
247-
/// </summary>
248-
[Obsolete("Use CaptureFeedback instead.")]
249-
public void CaptureUserFeedback(UserFeedback userFeedback)
250-
{
251-
}
252-
253245
/// <summary>
254246
/// No-Op.
255247
/// </summary>

src/Sentry/Extensibility/HubAdapter.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,4 @@ public SentryId CaptureCheckIn(
335335
[EditorBrowsable(EditorBrowsableState.Never)]
336336
public Task FlushAsync(TimeSpan timeout)
337337
=> SentrySdk.FlushAsync(timeout);
338-
339-
/// <summary>
340-
/// Forwards the call to <see cref="SentrySdk"/>
341-
/// </summary>
342-
[DebuggerStepThrough]
343-
[EditorBrowsable(EditorBrowsableState.Never)]
344-
[Obsolete("Use CaptureFeedback instead.")]
345-
public void CaptureUserFeedback(UserFeedback sentryUserFeedback)
346-
=> SentrySdk.CaptureUserFeedback(sentryUserFeedback);
347338
}

src/Sentry/ISentryClient.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ public interface ISentryClient
3636
/// <param name="hint">An optional hint providing high level context for the source of the event</param>
3737
public void CaptureFeedback(SentryFeedback feedback, Scope? scope = null, SentryHint? hint = null);
3838

39-
/// <summary>
40-
/// Captures a user feedback.
41-
/// </summary>
42-
/// <param name="userFeedback">The user feedback to send to Sentry.</param>
43-
[Obsolete("Use CaptureFeedback instead.")]
44-
public void CaptureUserFeedback(UserFeedback userFeedback);
45-
4639
/// <summary>
4740
/// Captures a transaction.
4841
/// </summary>

src/Sentry/Internal/Hub.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -662,34 +662,6 @@ internal void CaptureHeapDump(string dumpFile)
662662
}
663663
#endif
664664

665-
[Obsolete("Use CaptureFeedback instead.")]
666-
public void CaptureUserFeedback(UserFeedback userFeedback)
667-
{
668-
if (!IsEnabled)
669-
{
670-
return;
671-
}
672-
673-
try
674-
{
675-
if (!string.IsNullOrWhiteSpace(userFeedback.Email) && !EmailValidator.IsValidEmail(userFeedback.Email))
676-
{
677-
_options.LogWarning("Feedback email scrubbed due to invalid email format: '{0}'", userFeedback.Email);
678-
userFeedback = new UserFeedback(
679-
userFeedback.EventId,
680-
userFeedback.Name,
681-
null, // Scrubbed email
682-
userFeedback.Comments);
683-
}
684-
685-
CurrentClient.CaptureUserFeedback(userFeedback);
686-
}
687-
catch (Exception e)
688-
{
689-
_options.LogError(e, "Failure to capture user feedback: {0}", userFeedback.EventId);
690-
}
691-
}
692-
693665
public void CaptureTransaction(SentryTransaction transaction) => CaptureTransaction(transaction, null, null);
694666

695667
public void CaptureTransaction(SentryTransaction transaction, Scope? scope, SentryHint? hint)

src/Sentry/Protocol/Envelopes/Envelope.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -330,23 +330,6 @@ public static Envelope FromFeedback(
330330
return new Envelope(eventId, header, items);
331331
}
332332

333-
/// <summary>
334-
/// Creates an envelope that contains a single user feedback.
335-
/// </summary>
336-
[Obsolete("Use FromFeedback instead.")]
337-
public static Envelope FromUserFeedback(UserFeedback sentryUserFeedback)
338-
{
339-
var eventId = sentryUserFeedback.EventId;
340-
var header = CreateHeader(eventId);
341-
342-
var items = new[]
343-
{
344-
EnvelopeItem.FromUserFeedback(sentryUserFeedback)
345-
};
346-
347-
return new Envelope(eventId, header, items);
348-
}
349-
350333
/// <summary>
351334
/// Creates an envelope that contains a single transaction.
352335
/// </summary>

src/Sentry/Protocol/Envelopes/EnvelopeItem.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -231,20 +231,6 @@ public static EnvelopeItem FromFeedback(SentryEvent @event)
231231
return new EnvelopeItem(header, new JsonSerializable(@event));
232232
}
233233

234-
/// <summary>
235-
/// Creates an <see cref="EnvelopeItem"/> from <paramref name="sentryUserFeedback"/>.
236-
/// </summary>
237-
[Obsolete("Use FromFeedback instead.")]
238-
public static EnvelopeItem FromUserFeedback(UserFeedback sentryUserFeedback)
239-
{
240-
var header = new Dictionary<string, object?>(1, StringComparer.Ordinal)
241-
{
242-
[TypeKey] = TypeValueUserReport
243-
};
244-
245-
return new EnvelopeItem(header, new JsonSerializable(sentryUserFeedback));
246-
}
247-
248234
/// <summary>
249235
/// Creates an <see cref="EnvelopeItem"/> from <paramref name="transaction"/>.
250236
/// </summary>
@@ -417,18 +403,6 @@ private static async Task<ISerializable> DeserializePayloadAsync(
417403
return new JsonSerializable(sentryEvent);
418404
}
419405

420-
// User report
421-
if (string.Equals(payloadType, TypeValueUserReport, StringComparison.OrdinalIgnoreCase))
422-
{
423-
#pragma warning disable CS0618 // Type or member is obsolete
424-
var bufferLength = (int)(payloadLength ?? stream.Length);
425-
var buffer = await stream.ReadByteChunkAsync(bufferLength, cancellationToken).ConfigureAwait(false);
426-
var userFeedback = Json.Parse(buffer, UserFeedback.FromJson);
427-
#pragma warning restore CS0618 // Type or member is obsolete
428-
429-
return new JsonSerializable(userFeedback);
430-
}
431-
432406
// Transaction
433407
if (string.Equals(payloadType, TypeValueTransaction, StringComparison.OrdinalIgnoreCase))
434408
{

src/Sentry/SentryClient.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,6 @@ public void CaptureFeedback(SentryFeedback feedback, Scope? scope = null, Sentry
119119
CaptureEnvelope(envelope);
120120
}
121121

122-
/// <inheritdoc />
123-
[Obsolete("Use CaptureFeedback instead.")]
124-
public void CaptureUserFeedback(UserFeedback userFeedback)
125-
{
126-
if (userFeedback.EventId.Equals(SentryId.Empty))
127-
{
128-
// Ignore the user feedback if EventId is empty
129-
_options.LogWarning("User feedback dropped due to empty id.");
130-
return;
131-
}
132-
133-
CaptureEnvelope(Envelope.FromUserFeedback(userFeedback));
134-
}
135-
136122
/// <inheritdoc />
137123
public void CaptureTransaction(SentryTransaction transaction) => CaptureTransaction(transaction, null, null);
138124

src/Sentry/SentryClientExtensions.cs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,6 @@ public static void CaptureFeedback(this ISentryClient client, string message, st
4949
=> client.CaptureFeedback(new SentryFeedback(message, contactEmail, name, replayId, url, associatedEventId),
5050
scope, hint);
5151

52-
/// <summary>
53-
/// Captures a user feedback.
54-
/// </summary>
55-
/// <param name="client"></param>
56-
/// <param name="eventId">The event Id.</param>
57-
/// <param name="email">The user email.</param>
58-
/// <param name="comments">The user comments.</param>
59-
/// <param name="name">The optional username.</param>
60-
[Obsolete("Use CaptureFeedback instead.")]
61-
public static void CaptureUserFeedback(this ISentryClient client, SentryId eventId, string email, string comments,
62-
string? name = null)
63-
{
64-
if (!client.IsEnabled)
65-
{
66-
return;
67-
}
68-
69-
client.CaptureUserFeedback(new UserFeedback(eventId, name, email, comments));
70-
}
71-
7252
/// <summary>
7353
/// Flushes the queue of captured events until the timeout set in <see cref="SentryOptions.FlushTimeout"/>
7454
/// is reached.
@@ -125,7 +105,8 @@ public static Task FlushAsync(this ISentryClient client)
125105
/// </summary>
126106
/// <param name="clientOrHub"></param>
127107
/// <returns></returns>
128-
[Obsolete("This method is meant for external usage only")]
108+
[Obsolete("WARNING: This method is meant for internal usage only")]
109+
[EditorBrowsable(EditorBrowsableState.Never)]
129110
public static SentryOptions? GetInternalSentryOptions(this ISentryClient clientOrHub) =>
130111
clientOrHub.GetSentryOptions();
131112
}

0 commit comments

Comments
 (0)