Skip to content

Commit

Permalink
Remove deprecated fields (#1227)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Jan 18, 2023
1 parent f37506a commit 632a637
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 49 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## Unreleased

### Breaking Changes

- Remove deprecated fields ([#1227](https://github.com/getsentry/sentry-dart/pull/1227))
- Remove deprecated fields from the `Scope` class.
- `user(SentryUser? user)`, using the `setUser(SentryUser? user)` instead.
- `attachements`, using the `attachments` instead.
- Remove deprecated field from the `SentryFlutterOptions` class.
- `anrTimeoutIntervalMillis`, using the `anrTimeoutInterval` instead.
- `autoSessionTrackingIntervalMillis`, using the `autoSessionTrackingInterval` instead.

## 7.0.0-alpha.3

### Breaking Changes
Expand Down
11 changes: 7 additions & 4 deletions dart/lib/src/protocol/sentry_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SentryRequest {

final Map<String, String>? _other;

@Deprecated('Will be removed in v7')
@Deprecated('Will be removed in v8. Use [data] instead')
Map<String, String> get other => Map.unmodifiable(_other ?? const {});

/// The fragment of the request URL.
Expand All @@ -70,7 +70,8 @@ class SentryRequest {
dynamic data,
Map<String, String>? headers,
Map<String, String>? env,
@Deprecated('Will be removed in v7.') Map<String, String>? other,
@Deprecated('Will be removed in v8. Use [data] instead')
Map<String, String>? other,
}) : _data = data,
_headers = headers != null ? Map.from(headers) : null,
// Look for a 'Set-Cookie' header (case insensitive) if not given.
Expand All @@ -88,7 +89,8 @@ class SentryRequest {
dynamic data,
Map<String, String>? headers,
Map<String, String>? env,
@Deprecated('Will be removed in v7.') Map<String, String>? other,
@Deprecated('Will be removed in v8. Use [data] instead')
Map<String, String>? other,
}) {
// As far as I can tell there's no way to get the uri without the query part
// so we replace it with an empty string.
Expand Down Expand Up @@ -158,7 +160,8 @@ class SentryRequest {
dynamic data,
Map<String, String>? headers,
Map<String, String>? env,
@Deprecated('Will be removed in v7.') Map<String, String>? other,
@Deprecated('Will be removed in v8. Use [data] instead')
Map<String, String>? other,
}) =>
SentryRequest(
url: url ?? this.url,
Expand Down
6 changes: 3 additions & 3 deletions dart/lib/src/protocol/sentry_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SentryUser {
this.geo,
this.name,
Map<String, dynamic>? data,
@Deprecated('Will be removed in v7. Use [data] instead')
@Deprecated('Will be removed in v8. Use [data] instead')
Map<String, dynamic>? extras,
}) : assert(
id != null ||
Expand Down Expand Up @@ -76,7 +76,7 @@ class SentryUser {
/// by Sentry.
final Map<String, dynamic>? data;

@Deprecated('Will be removed in v7. Use [data] instead')
@Deprecated('Will be removed in v8. Use [data] instead')
final Map<String, dynamic>? extras;

/// Approximate geographical location of the end user or device.
Expand Down Expand Up @@ -144,7 +144,7 @@ class SentryUser {
String? email,
String? ipAddress,
String? segment,
@Deprecated('Will be removed in v7. Use [data] instead')
@Deprecated('Will be removed in v8. Use [data] instead')
Map<String, dynamic>? extras,
String? name,
SentryGeo? geo,
Expand Down
13 changes: 0 additions & 13 deletions dart/lib/src/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ class Scope {
/// Get the current user.
SentryUser? get user => _user;

/// Sets the current user
/// This method is deprecated, use the [setUser(user)] instead.
/// This method will be removed in the future.
/// The breaking change is due to the [enableScopeSync] feature that
/// requires returning a [Future].
@Deprecated('Use [setUser(user)] instead')
set user(SentryUser? user) {
_user = user;
}

void _setUserSync(SentryUser? user) {
_user = user;
}
Expand Down Expand Up @@ -151,9 +141,6 @@ class Scope {

List<SentryAttachment> get attachments => List.unmodifiable(_attachments);

@Deprecated('Use [attachments] instead')
List<SentryAttachment> get attachements => attachments;

Scope(this._options);

bool _addBreadCrumbSync(Breadcrumb breadcrumb, {Hint? hint}) {
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ typedef TracesSamplerCallback = double? Function(
SentrySamplingContext samplingContext);

/// A NoOp logger that does nothing
@Deprecated('This will be made private or removed in the future')
@Deprecated('Will be removed in v8. Disable [debug] instead')
void noOpLogger(
SentryLevel level,
String message, {
Expand All @@ -446,7 +446,7 @@ void noOpLogger(
}) {}

/// A Logger that prints out the level and message
@Deprecated('This will be made private or removed in the future')
@Deprecated('Will be removed in v8. Enable [debug] instead')
void dartLogger(
SentryLevel level,
String message, {
Expand Down
27 changes: 0 additions & 27 deletions flutter/lib/src/sentry_flutter_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,6 @@ class SentryFlutterOptions extends SentryOptions {
/// feature, as this is required to mark Sessions as Crashed.
bool enableNativeCrashHandling = true;

/// The session tracking interval in millis. This is the interval to end a
/// session if the App goes to the background.
/// See: [enableAutoSessionTracking]
@Deprecated('Use autoSessionTrackingInterval instead')
int get autoSessionTrackingIntervalMillis =>
autoSessionTrackingInterval.inMilliseconds;

@Deprecated('Use autoSessionTrackingInterval instead')
set autoSessionTrackingIntervalMillis(int value) {
autoSessionTrackingInterval = value >= 0
? Duration(milliseconds: value)
: autoSessionTrackingInterval;
}

Duration _autoSessionTrackingInterval = Duration(milliseconds: 30000);

/// The session tracking interval. This is the interval to end a
Expand All @@ -74,19 +60,6 @@ class SentryFlutterOptions extends SentryOptions {
/// Java/Kotlin code as well.
bool anrEnabled = false;

/// ANR Timeout internal in Millis Default is 5000 = 5s Used by AnrIntegration.
/// Available only for Android.
/// See: [anrEnabled]
@Deprecated('Use anrTimeoutInterval instead')
int get anrTimeoutIntervalMillis => anrTimeoutInterval.inMilliseconds;

@Deprecated('Use anrTimeoutInterval instead')
set anrTimeoutIntervalMillis(int value) {
assert(value > 0);
anrTimeoutInterval =
value > 0 ? Duration(milliseconds: value) : anrTimeoutInterval;
}

Duration _anrTimeoutInterval = Duration(milliseconds: 5000);

/// ANR Timeout internal. Default is 5000 milliseconds or 5 seconds.
Expand Down

0 comments on commit 632a637

Please sign in to comment.