Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

- 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))
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602))
- Removed obsolete v6 APIs ([#4619](https://github.com/getsentry/sentry-dotnet/pull/4619))
- 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)>`.
- Removed `SentrySdk.CaptureUserFeedback` and all associated members. Use the newer `SentrySdk.CaptureFeedback` instead.

## 6.0.0-preview.1

Expand Down
16 changes: 0 additions & 16 deletions src/Sentry.Maui/BreadcrumbEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,4 @@ public BreadcrumbEvent(
e => new KeyValuePair<string, string>(e.key, e.value)))
{
}

/// <summary>
/// This constructor remains for backward compatibility.
/// </summary>
/// <param name="sender"></param>
/// <param name="eventName"></param>
/// <param name="extraData"></param>
[Obsolete("Use one of the other simpler constructors instead.")]
public BreadcrumbEvent(
object? sender,
string eventName,
IEnumerable<(string Key, string Value)>[] extraData) : this(sender, eventName, extraData.SelectMany(
x => x.Select(pair => new KeyValuePair<string, string>(pair.Key, pair.Value)))
)
{
}
}
8 changes: 0 additions & 8 deletions src/Sentry/Extensibility/DisabledHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,6 @@ public void Dispose()
{
}

/// <summary>
/// No-Op.
/// </summary>
[Obsolete("Use CaptureFeedback instead.")]
public void CaptureUserFeedback(UserFeedback userFeedback)
{
}

/// <summary>
/// No-Op.
/// </summary>
Expand Down
9 changes: 0 additions & 9 deletions src/Sentry/Extensibility/HubAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,4 @@ public SentryId CaptureCheckIn(
[EditorBrowsable(EditorBrowsableState.Never)]
public Task FlushAsync(TimeSpan timeout)
=> SentrySdk.FlushAsync(timeout);

/// <summary>
/// Forwards the call to <see cref="SentrySdk"/>
/// </summary>
[DebuggerStepThrough]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Use CaptureFeedback instead.")]
public void CaptureUserFeedback(UserFeedback sentryUserFeedback)
=> SentrySdk.CaptureUserFeedback(sentryUserFeedback);
}
7 changes: 0 additions & 7 deletions src/Sentry/ISentryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ public interface ISentryClient
/// <param name="hint">An optional hint providing high level context for the source of the event</param>
public void CaptureFeedback(SentryFeedback feedback, Scope? scope = null, SentryHint? hint = null);

/// <summary>
/// Captures a user feedback.
/// </summary>
/// <param name="userFeedback">The user feedback to send to Sentry.</param>
[Obsolete("Use CaptureFeedback instead.")]
public void CaptureUserFeedback(UserFeedback userFeedback);

/// <summary>
/// Captures a transaction.
/// </summary>
Expand Down
28 changes: 0 additions & 28 deletions src/Sentry/Internal/Hub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -661,34 +661,6 @@ internal void CaptureHeapDump(string dumpFile)
}
#endif

[Obsolete("Use CaptureFeedback instead.")]
public void CaptureUserFeedback(UserFeedback userFeedback)
{
if (!IsEnabled)
{
return;
}

try
{
if (!string.IsNullOrWhiteSpace(userFeedback.Email) && !EmailValidator.IsValidEmail(userFeedback.Email))
{
_options.LogWarning("Feedback email scrubbed due to invalid email format: '{0}'", userFeedback.Email);
userFeedback = new UserFeedback(
userFeedback.EventId,
userFeedback.Name,
null, // Scrubbed email
userFeedback.Comments);
}

CurrentClient.CaptureUserFeedback(userFeedback);
}
catch (Exception e)
{
_options.LogError(e, "Failure to capture user feedback: {0}", userFeedback.EventId);
}
}

public void CaptureTransaction(SentryTransaction transaction) => CaptureTransaction(transaction, null, null);

public void CaptureTransaction(SentryTransaction transaction, Scope? scope, SentryHint? hint)
Expand Down
17 changes: 0 additions & 17 deletions src/Sentry/Protocol/Envelopes/Envelope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,23 +330,6 @@ public static Envelope FromFeedback(
return new Envelope(eventId, header, items);
}

/// <summary>
/// Creates an envelope that contains a single user feedback.
/// </summary>
[Obsolete("Use FromFeedback instead.")]
public static Envelope FromUserFeedback(UserFeedback sentryUserFeedback)
{
var eventId = sentryUserFeedback.EventId;
var header = CreateHeader(eventId);

var items = new[]
{
EnvelopeItem.FromUserFeedback(sentryUserFeedback)
};

return new Envelope(eventId, header, items);
}

/// <summary>
/// Creates an envelope that contains a single transaction.
/// </summary>
Expand Down
26 changes: 0 additions & 26 deletions src/Sentry/Protocol/Envelopes/EnvelopeItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,6 @@ public static EnvelopeItem FromFeedback(SentryEvent @event)
return new EnvelopeItem(header, new JsonSerializable(@event));
}

/// <summary>
/// Creates an <see cref="EnvelopeItem"/> from <paramref name="sentryUserFeedback"/>.
/// </summary>
[Obsolete("Use FromFeedback instead.")]
public static EnvelopeItem FromUserFeedback(UserFeedback sentryUserFeedback)
{
var header = new Dictionary<string, object?>(1, StringComparer.Ordinal)
{
[TypeKey] = TypeValueUserReport
};

return new EnvelopeItem(header, new JsonSerializable(sentryUserFeedback));
}

/// <summary>
/// Creates an <see cref="EnvelopeItem"/> from <paramref name="transaction"/>.
/// </summary>
Expand Down Expand Up @@ -417,18 +403,6 @@ private static async Task<ISerializable> DeserializePayloadAsync(
return new JsonSerializable(sentryEvent);
}

// User report
if (string.Equals(payloadType, TypeValueUserReport, StringComparison.OrdinalIgnoreCase))
{
#pragma warning disable CS0618 // Type or member is obsolete
var bufferLength = (int)(payloadLength ?? stream.Length);
var buffer = await stream.ReadByteChunkAsync(bufferLength, cancellationToken).ConfigureAwait(false);
var userFeedback = Json.Parse(buffer, UserFeedback.FromJson);
#pragma warning restore CS0618 // Type or member is obsolete

return new JsonSerializable(userFeedback);
}

// Transaction
if (string.Equals(payloadType, TypeValueTransaction, StringComparison.OrdinalIgnoreCase))
{
Expand Down
14 changes: 0 additions & 14 deletions src/Sentry/SentryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,6 @@ public void CaptureFeedback(SentryFeedback feedback, Scope? scope = null, Sentry
CaptureEnvelope(envelope);
}

/// <inheritdoc />
[Obsolete("Use CaptureFeedback instead.")]
public void CaptureUserFeedback(UserFeedback userFeedback)
{
if (userFeedback.EventId.Equals(SentryId.Empty))
{
// Ignore the user feedback if EventId is empty
_options.LogWarning("User feedback dropped due to empty id.");
return;
}

CaptureEnvelope(Envelope.FromUserFeedback(userFeedback));
}

/// <inheritdoc />
public void CaptureTransaction(SentryTransaction transaction) => CaptureTransaction(transaction, null, null);

Expand Down
23 changes: 2 additions & 21 deletions src/Sentry/SentryClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,6 @@ public static void CaptureFeedback(this ISentryClient client, string message, st
=> client.CaptureFeedback(new SentryFeedback(message, contactEmail, name, replayId, url, associatedEventId),
scope, hint);

/// <summary>
/// Captures a user feedback.
/// </summary>
/// <param name="client"></param>
/// <param name="eventId">The event Id.</param>
/// <param name="email">The user email.</param>
/// <param name="comments">The user comments.</param>
/// <param name="name">The optional username.</param>
[Obsolete("Use CaptureFeedback instead.")]
public static void CaptureUserFeedback(this ISentryClient client, SentryId eventId, string email, string comments,
string? name = null)
{
if (!client.IsEnabled)
{
return;
}

client.CaptureUserFeedback(new UserFeedback(eventId, name, email, comments));
}

/// <summary>
/// Flushes the queue of captured events until the timeout set in <see cref="SentryOptions.FlushTimeout"/>
/// is reached.
Expand Down Expand Up @@ -125,7 +105,8 @@ public static Task FlushAsync(this ISentryClient client)
/// </summary>
/// <param name="clientOrHub"></param>
/// <returns></returns>
[Obsolete("This method is meant for external usage only")]
[Obsolete("WARNING: This method is meant for internal usage only")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static SentryOptions? GetInternalSentryOptions(this ISentryClient clientOrHub) =>
clientOrHub.GetSentryOptions();
}
21 changes: 0 additions & 21 deletions src/Sentry/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -566,27 +566,6 @@ public static void CaptureFeedback(string message, string? contactEmail = null,
=> CurrentHub.CaptureFeedback(new SentryFeedback(message, contactEmail, name, replayId, url, associatedEventId),
scope, hint);

/// <summary>
/// Captures a user feedback.
/// </summary>
/// <param name="userFeedback">The user feedback to send to Sentry.</param>
[DebuggerStepThrough]
[Obsolete("Use CaptureFeedback instead.")]
public static void CaptureUserFeedback(UserFeedback userFeedback)
=> CurrentHub.CaptureUserFeedback(userFeedback);

/// <summary>
/// Captures a user feedback.
/// </summary>
/// <param name="eventId">The event Id.</param>
/// <param name="email">The user email.</param>
/// <param name="comments">The user comments.</param>
/// <param name="name">The optional username.</param>
[DebuggerStepThrough]
[Obsolete("Use CaptureFeedback instead.")]
public static void CaptureUserFeedback(SentryId eventId, string email, string comments, string? name = null)
=> CurrentHub.CaptureUserFeedback(new UserFeedback(eventId, name, email, comments));

/// <summary>
/// Captures a transaction.
/// </summary>
Expand Down
68 changes: 0 additions & 68 deletions src/Sentry/UserFeedback.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ namespace Sentry.Maui
public BreadcrumbEvent(object? sender, string eventName, [System.Runtime.CompilerServices.ParamCollection] [System.Runtime.CompilerServices.TupleElementNames(new string[] {
"key",
"value"})] System.Collections.Generic.IEnumerable<System.ValueTuple<string, string>> extraData) { }
[System.Obsolete("Use one of the other simpler constructors instead.")]
public BreadcrumbEvent(object? sender, string eventName, [System.Runtime.CompilerServices.TupleElementNames(new string[] {
"Key",
"Value"})] System.Collections.Generic.IEnumerable<System.ValueTuple<string, string>>[] extraData) { }
public string EventName { get; }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> ExtraData { get; }
public object? Sender { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ namespace Sentry.Maui
public BreadcrumbEvent(object? sender, string eventName, [System.Runtime.CompilerServices.ParamCollection] [System.Runtime.CompilerServices.TupleElementNames(new string[] {
"key",
"value"})] System.Collections.Generic.IEnumerable<System.ValueTuple<string, string>> extraData) { }
[System.Obsolete("Use one of the other simpler constructors instead.")]
public BreadcrumbEvent(object? sender, string eventName, [System.Runtime.CompilerServices.TupleElementNames(new string[] {
"Key",
"Value"})] System.Collections.Generic.IEnumerable<System.ValueTuple<string, string>>[] extraData) { }
public string EventName { get; }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> ExtraData { get; }
public object? Sender { get; }
Expand Down
4 changes: 1 addition & 3 deletions test/Sentry.Maui.Tests/BreadcrumbEventTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ public void BreadcrumbEvent_OldConstructor_EquivalentToNewConstructor()
var eventName = "TestEvent";

// Act
IEnumerable<(string Key, string Value)>[] extraData = [[("key1", "value1")], [("key2", "value2")]];
#pragma warning disable CS0618 // Type or member is obsolete
IEnumerable<(string Key, string Value)> extraData = [("key1", "value1"), ("key2", "value2")];
var oldEvent = new BreadcrumbEvent(sender, eventName, extraData);
#pragma warning restore CS0618 // Type or member is obsolete
var newEvent = new BreadcrumbEvent(sender, eventName, ("key1", "value1"), ("key2", "value2"));

// Assert
Expand Down
Loading
Loading