Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v9] Remove old user feedback api #2686

Merged
merged 14 commits into from
Feb 18, 2025
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Increase minimum SDK version requirements to Dart v3.5.0 and Flutter v3.24.0 ([#2643](https://github.com/getsentry/sentry-dart/pull/2643))
- Remove screenshot option `attachScreenshotOnlyWhenResumed` ([#2664](https://github.com/getsentry/sentry-dart/pull/2664))
- Remove deprecated `beforeScreenshot` ([#2662](https://github.com/getsentry/sentry-dart/pull/2662))
- Remove old user feedback api ([#2686](https://github.com/getsentry/sentry-dart/pull/2686))
- Remove deprecated loggers ([#2685](https://github.com/getsentry/sentry-dart/pull/2685))
- Remove user segment ([#2687](https://github.com/getsentry/sentry-dart/pull/2687))
- Enable JS SDK native integration by default ([#2688](https://github.com/getsentry/sentry-dart/pull/2688))
Expand Down
66 changes: 28 additions & 38 deletions dart/lib/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,50 @@
/// A pure Dart client for Sentry.io crash reporting.
library;

export 'src/run_zoned_guarded_integration.dart';
export 'src/event_processor.dart';
export 'src/exception_cause.dart';
export 'src/exception_cause_extractor.dart';
export 'src/exception_stacktrace_extractor.dart';
export 'src/exception_type_identifier.dart';
export 'src/hint.dart';
export 'src/http_client/sentry_http_client.dart';
export 'src/http_client/sentry_http_client_error.dart';
export 'src/hub.dart';
// useful for tests
export 'src/hub_adapter.dart';
export 'src/platform_checker.dart';
export 'src/integration.dart';
export 'src/noop_isolate_error_integration.dart'
if (dart.library.io) 'src/isolate_error_integration.dart';
export 'src/performance_collector.dart';
export 'src/platform_checker.dart';
export 'src/protocol.dart';
export 'src/protocol/sentry_feedback.dart';
export 'src/protocol/sentry_proxy.dart';
export 'src/run_zoned_guarded_integration.dart';
export 'src/scope.dart';
export 'src/scope_observer.dart';
export 'src/sentry.dart';
export 'src/sentry_attachment/sentry_attachment.dart';
export 'src/sentry_baggage.dart';
export 'src/sentry_client.dart';
export 'src/sentry_envelope.dart';
export 'src/sentry_envelope_item.dart';
export 'src/sentry_client.dart';
export 'src/sentry_options.dart';
// useful for integrations
// ignore: invalid_export_of_internal_element
export 'src/sentry_span_operations.dart';
// ignore: invalid_export_of_internal_element
export 'src/sentry_trace_origins.dart';
export 'src/span_data_convention.dart';
export 'src/spotlight.dart';
export 'src/throwable_mechanism.dart';
export 'src/transport/transport.dart';
export 'src/integration.dart';
export 'src/event_processor.dart';
export 'src/http_client/sentry_http_client.dart';
export 'src/http_client/sentry_http_client_error.dart';
export 'src/sentry_attachment/sentry_attachment.dart';
export 'src/sentry_user_feedback.dart';
export 'src/utils/tracing_utils.dart';
export 'src/performance_collector.dart';
// tracing
export 'src/tracing.dart';
export 'src/hint.dart';
export 'src/transport/transport.dart';
export 'src/type_check_hint.dart';
export 'src/sentry_baggage.dart';
// exception extraction
export 'src/exception_cause_extractor.dart';
export 'src/exception_cause.dart';
export 'src/exception_stacktrace_extractor.dart';
export 'src/exception_type_identifier.dart';
// URL
// ignore: invalid_export_of_internal_element
export 'src/utils/http_sanitizer.dart';
// ignore: invalid_export_of_internal_element
export 'src/utils/url_details.dart';
export 'src/utils.dart';
// ignore: invalid_export_of_internal_element
export 'src/utils/http_header_utils.dart';
// ignore: invalid_export_of_internal_element
export 'src/sentry_trace_origins.dart';
// ignore: invalid_export_of_internal_element
export 'src/sentry_span_operations.dart';
export 'src/utils/http_sanitizer.dart';
export 'src/utils/tracing_utils.dart';
// ignore: invalid_export_of_internal_element
export 'src/utils.dart';
// spotlight debugging
export 'src/spotlight.dart';
// proxy
export 'src/protocol/sentry_proxy.dart';
// feedback
export 'src/protocol/sentry_feedback.dart';
// constants
export 'src/span_data_convention.dart';
export 'src/utils/url_details.dart';
34 changes: 0 additions & 34 deletions dart/lib/src/hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,40 +242,6 @@ class Hub {
return sentryId;
}

@Deprecated(
'Will be removed in a future version. Use [captureFeedback] instead')
Future<void> captureUserFeedback(SentryUserFeedback userFeedback) async {
if (!_isEnabled) {
_options.logger(
SentryLevel.warning,
"Instance is disabled and this 'captureUserFeedback' call is a no-op.",
);
return;
}
if (userFeedback.eventId == SentryId.empty()) {
_options.logger(
SentryLevel.warning,
'Captured UserFeedback with empty id, dropping the feedback',
);
return;
}
try {
final item = _peek();

await item.client.captureUserFeedback(userFeedback);
} catch (exception, stacktrace) {
_options.logger(
SentryLevel.error,
'Error while capturing user feedback for ${userFeedback.eventId}',
exception: exception,
stackTrace: stacktrace,
);
if (_options.automatedTestMode) {
rethrow;
}
}
}

/// Captures the feedback.
Future<SentryId> captureFeedback(
SentryFeedback feedback, {
Expand Down
7 changes: 0 additions & 7 deletions dart/lib/src/hub_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'scope.dart';
import 'sentry.dart';
import 'sentry_client.dart';
import 'sentry_options.dart';
import 'sentry_user_feedback.dart';
import 'tracing.dart';

/// Hub adapter to make Integrations testable
Expand Down Expand Up @@ -112,12 +111,6 @@ class HubAdapter implements Hub {
@override
ISentrySpan? getSpan() => Sentry.currentHub.getSpan();

@override
// ignore: deprecated_member_use_from_same_package
Future<void> captureUserFeedback(SentryUserFeedback userFeedback) =>
// ignore: deprecated_member_use_from_same_package
Sentry.captureUserFeedback(userFeedback);

@override
ISentrySpan startTransactionWithContext(
SentryTransactionContext transactionContext, {
Expand Down
5 changes: 0 additions & 5 deletions dart/lib/src/noop_hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'protocol/sentry_feedback.dart';
import 'scope.dart';
import 'sentry_client.dart';
import 'sentry_options.dart';
import 'sentry_user_feedback.dart';
import 'tracing.dart';

class NoOpHub implements Hub {
Expand Down Expand Up @@ -86,10 +85,6 @@ class NoOpHub implements Hub {
}) async =>
SentryId.empty();

@override
// ignore: deprecated_member_use_from_same_package
Future<void> captureUserFeedback(SentryUserFeedback userFeedback) async {}

@override
Future<SentryId> captureFeedback(
SentryFeedback feedback, {
Expand Down
5 changes: 0 additions & 5 deletions dart/lib/src/noop_sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'scope.dart';
import 'sentry_client.dart';
import 'sentry_envelope.dart';
import 'sentry_trace_context_header.dart';
import 'sentry_user_feedback.dart';

class NoOpSentryClient implements SentryClient {
NoOpSentryClient._();
Expand Down Expand Up @@ -51,10 +50,6 @@ class NoOpSentryClient implements SentryClient {
Future<SentryId> captureEnvelope(SentryEnvelope envelope) async =>
SentryId.empty();

@override
// ignore: deprecated_member_use_from_same_package
Future<void> captureUserFeedback(SentryUserFeedback userFeedback) async {}

@override
Future<void> close() async {}

Expand Down
9 changes: 0 additions & 9 deletions dart/lib/src/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import 'sentry_attachment/sentry_attachment.dart';
import 'sentry_client.dart';
import 'sentry_options.dart';
import 'sentry_run_zoned_guarded.dart';
import 'sentry_user_feedback.dart';
import 'tracing.dart';
import 'transport/data_category.dart';
import 'transport/task_queue.dart';
Expand Down Expand Up @@ -249,14 +248,6 @@ class Sentry {
DataCategory.unknown,
);

/// Reports a [userFeedback] to Sentry.io.
///
/// First capture an event and use the [SentryId] to create a [SentryUserFeedback]
@Deprecated(
'Will be removed in a future version. Use [captureFeedback] instead')
static Future<void> captureUserFeedback(SentryUserFeedback userFeedback) =>
_hub.captureUserFeedback(userFeedback);

/// Reports [SentryFeedback] to Sentry.io.
///
/// Use [withScope] to add [SentryAttachment] to the feedback.
Expand Down
13 changes: 0 additions & 13 deletions dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import 'sentry_exception_factory.dart';
import 'sentry_options.dart';
import 'sentry_stack_trace_factory.dart';
import 'sentry_trace_context_header.dart';
import 'sentry_user_feedback.dart';
import 'transport/client_report_transport.dart';
import 'transport/data_category.dart';
import 'transport/http_transport.dart';
Expand Down Expand Up @@ -444,18 +443,6 @@ class SentryClient {
return _options.transport.send(envelope);
}

/// Reports the [userFeedback] to Sentry.io.
@Deprecated(
'Will be removed in a future version. Use [captureFeedback] instead')
Future<void> captureUserFeedback(SentryUserFeedback userFeedback) {
final envelope = SentryEnvelope.fromUserFeedback(
userFeedback,
_options.sdk,
dsn: _options.dsn,
);
return _options.transport.send(envelope);
}

/// Reports the [feedback] to Sentry.io.
Future<SentryId> captureFeedback(
SentryFeedback feedback, {
Expand Down
18 changes: 0 additions & 18 deletions dart/lib/src/sentry_envelope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'sentry_envelope_item.dart';
import 'sentry_item_type.dart';
import 'sentry_options.dart';
import 'sentry_trace_context_header.dart';
import 'sentry_user_feedback.dart';
import 'utils.dart';

/// Class representation of `Envelope` file.
Expand Down Expand Up @@ -59,23 +58,6 @@ class SentryEnvelope {
);
}

@Deprecated('Will be removed in a future version.')
factory SentryEnvelope.fromUserFeedback(
SentryUserFeedback feedback,
SdkVersion sdkVersion, {
String? dsn,
}) {
return SentryEnvelope(
// no need for [traceContext]
SentryEnvelopeHeader(
feedback.eventId,
sdkVersion,
dsn: dsn,
),
[SentryEnvelopeItem.fromUserFeedback(feedback)],
);
}

/// Create a [SentryEnvelope] containing one [SentryEnvelopeItem] which holds the [SentryTransaction] data.
factory SentryEnvelope.fromTransaction(
SentryTransaction transaction,
Expand Down
17 changes: 0 additions & 17 deletions dart/lib/src/sentry_envelope_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'protocol.dart';
import 'sentry_attachment/sentry_attachment.dart';
import 'sentry_envelope_item_header.dart';
import 'sentry_item_type.dart';
import 'sentry_user_feedback.dart';
import 'utils.dart';

/// Item holding header information and JSON encoded data.
Expand Down Expand Up @@ -40,22 +39,6 @@ class SentryEnvelopeItem {
);
}

/// Create a [SentryEnvelopeItem] which sends [SentryUserFeedback].
@Deprecated('Will be removed in a future version.')
factory SentryEnvelopeItem.fromUserFeedback(SentryUserFeedback feedback) {
final dataFactory = () => utf8JsonEncoder.convert(feedback.toJson());

final header = SentryEnvelopeItemHeader(
SentryItemType.userFeedback,
contentType: 'application/json',
);
return SentryEnvelopeItem(
header,
dataFactory,
originalObject: feedback,
);
}

/// Create a [SentryEnvelopeItem] which holds the [SentryEvent] data.
factory SentryEnvelopeItem.fromEvent(SentryEvent event) {
return SentryEnvelopeItem(
Expand Down
1 change: 0 additions & 1 deletion dart/lib/src/sentry_item_type.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class SentryItemType {
static const String event = 'event';
static const String userFeedback = 'user_report';
static const String attachment = 'attachment';
static const String transaction = 'transaction';
static const String clientReport = 'client_report';
Expand Down
69 changes: 0 additions & 69 deletions dart/lib/src/sentry_user_feedback.dart

This file was deleted.

Loading
Loading