Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion metrics/metrics-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ startupTimeTest:

binarySizeTest:
diffMin: 900 KiB
diffMax: 1350 KiB
diffMax: 1450 KiB
1 change: 1 addition & 0 deletions packages/dart/lib/src/hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ class Hub {
}

/// Clones the Hub
@internal
Hub clone() {
if (!_isEnabled) {
_options.log(SentryLevel.warning, 'Disabled Hub cloned.');
Expand Down
1 change: 1 addition & 0 deletions packages/dart/lib/src/hub_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class HubAdapter implements Hub {
withScope: withScope,
);

@internal
@override
Hub clone() => Sentry.clone();

Expand Down
1 change: 1 addition & 0 deletions packages/dart/lib/src/noop_hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class NoOpHub implements Hub {
}) async =>
SentryId.empty();

@internal
@override
Hub clone() => this;

Expand Down
21 changes: 0 additions & 21 deletions packages/dart/lib/src/protocol/contexts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -322,27 +322,6 @@ class Contexts extends MapView<String, dynamic> {
return json;
}

@Deprecated('Will be removed in a future version.')
Contexts clone() {
final copy = Contexts(
device: device?.clone(),
operatingSystem: operatingSystem?.clone(),
app: app?.clone(),
browser: browser?.clone(),
culture: culture?.clone(),
gpu: gpu?.clone(),
trace: trace?.clone(),
response: response?.clone(),
runtimes: runtimes.map((runtime) => runtime.clone()).toList(),
feedback: feedback?.clone(),
flags: flags?.clone(),
)..addEntries(
entries.where((element) => !defaultFields.contains(element.key)),
);

return copy;
}

@Deprecated(
'Will be removed in a future version. Assign values directly to the instance.')
Contexts copyWith({
Expand Down
16 changes: 0 additions & 16 deletions packages/dart/lib/src/protocol/sentry_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,6 @@ class SentryApp {
return attributes;
}

@Deprecated('Will be removed in a future version.')
SentryApp clone() => SentryApp(
name: name,
version: version,
identifier: identifier,
build: build,
buildType: buildType,
startTime: startTime,
deviceAppHash: deviceAppHash,
appMemory: appMemory,
inForeground: inForeground,
viewNames: viewNames,
textScale: textScale,
unknown: unknown,
);

@Deprecated('Assign values directly to the instance.')
SentryApp copyWith({
String? name,
Expand Down
7 changes: 0 additions & 7 deletions packages/dart/lib/src/protocol/sentry_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ class SentryBrowser {
};
}

@Deprecated('Will be removed in a future version.')
SentryBrowser clone() => SentryBrowser(
name: name,
version: version,
unknown: unknown,
);

@Deprecated('Assign values directly to the instance.')
SentryBrowser copyWith({
String? name,
Expand Down
10 changes: 0 additions & 10 deletions packages/dart/lib/src/protocol/sentry_culture.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,6 @@ class SentryCulture {
};
}

@Deprecated('Will be removed in a future version.')
SentryCulture clone() => SentryCulture(
calendar: calendar,
displayName: displayName,
locale: locale,
is24HourFormat: is24HourFormat,
timezone: timezone,
unknown: unknown,
);

@Deprecated('Assign values directly to the instance.')
SentryCulture copyWith({
String? calendar,
Expand Down
41 changes: 0 additions & 41 deletions packages/dart/lib/src/protocol/sentry_device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -427,47 +427,6 @@ class SentryDevice {
return attributes;
}

@Deprecated('Will be removed in a future version.')
SentryDevice clone() => SentryDevice(
name: name,
family: family,
model: model,
modelId: modelId,
arch: arch,
batteryLevel: batteryLevel,
orientation: orientation,
manufacturer: manufacturer,
brand: brand,
screenHeightPixels: screenHeightPixels,
screenWidthPixels: screenWidthPixels,
screenDensity: screenDensity,
screenDpi: screenDpi,
online: online,
charging: charging,
lowMemory: lowMemory,
simulator: simulator,
memorySize: memorySize,
freeMemory: freeMemory,
usableMemory: usableMemory,
storageSize: storageSize,
freeStorage: freeStorage,
externalStorageSize: externalStorageSize,
externalFreeStorage: externalFreeStorage,
bootTime: bootTime,
processorCount: processorCount,
cpuDescription: cpuDescription,
processorFrequency: processorFrequency,
deviceType: deviceType,
batteryStatus: batteryStatus,
deviceUniqueIdentifier: deviceUniqueIdentifier,
supportsVibration: supportsVibration,
supportsAccelerometer: supportsAccelerometer,
supportsGyroscope: supportsGyroscope,
supportsAudio: supportsAudio,
supportsLocationService: supportsLocationService,
unknown: unknown,
);

@Deprecated('Assign values directly to the instance.')
SentryDevice copyWith({
String? name,
Expand Down
6 changes: 1 addition & 5 deletions packages/dart/lib/src/protocol/sentry_feature_flag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ class SentryFeatureFlag {
};
}

// Uses copy rather than clone because clone is currently a deprecated public API.
@internal
SentryFeatureFlag copy() {
SentryFeatureFlag clone() {
return SentryFeatureFlag(
flag: flag,
result: result,
Expand All @@ -55,7 +54,4 @@ class SentryFeatureFlag {
unknown: unknown ?? this.unknown,
);
}

@Deprecated('Will be removed in a future version.')
SentryFeatureFlag clone() => copyWith();
Comment thread
buenaflor marked this conversation as resolved.
}
8 changes: 2 additions & 6 deletions packages/dart/lib/src/protocol/sentry_feature_flags.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ class SentryFeatureFlags {
};
}

// Uses copy rather than clone because clone is currently a deprecated public API.
@internal
SentryFeatureFlags copy() {
SentryFeatureFlags clone() {
final unknown = this.unknown;
return SentryFeatureFlags(
values: values.map((flag) => flag.copy()).toList(growable: false),
values: values.map((flag) => flag.clone()).toList(growable: false),
unknown: unknown == null ? null : Map<String, dynamic>.from(unknown),
);
}
Expand All @@ -57,7 +56,4 @@ class SentryFeatureFlags {
unknown: unknown ?? this.unknown,
);
}

@Deprecated('Will be removed in a future version.')
SentryFeatureFlags clone() => copyWith();
}
3 changes: 0 additions & 3 deletions packages/dart/lib/src/protocol/sentry_feedback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,4 @@ class SentryFeedback {
associatedEventId: associatedEventId ?? this.associatedEventId,
unknown: unknown ?? this.unknown,
);

@Deprecated('Will be removed in a future version.')
SentryFeedback clone() => copyWith();
}
20 changes: 0 additions & 20 deletions packages/dart/lib/src/protocol/sentry_gpu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,26 +111,6 @@ class SentryGpu {
);
}

@Deprecated('Will be removed in a future version.')
SentryGpu clone() => SentryGpu(
name: name,
id: id,
vendorId: vendorId,
vendorName: vendorName,
memorySize: memorySize,
apiType: apiType,
multiThreadedRendering: multiThreadedRendering,
version: version,
npotSupport: npotSupport,
graphicsShaderLevel: graphicsShaderLevel,
maxTextureSize: maxTextureSize,
supportsComputeShaders: supportsComputeShaders,
supportsDrawCallInstancing: supportsDrawCallInstancing,
supportsGeometryShaders: supportsGeometryShaders,
supportsRayTracing: supportsRayTracing,
unknown: unknown,
);

/// Produces a [Map] that can be serialized to JSON.
Map<String, dynamic> toJson() {
return {
Expand Down
12 changes: 0 additions & 12 deletions packages/dart/lib/src/protocol/sentry_operating_system.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,6 @@ class SentryOperatingSystem {
return attributes;
}

@Deprecated('Will be removed in a future version.')
SentryOperatingSystem clone() => SentryOperatingSystem(
name: name,
version: version,
build: build,
kernelVersion: kernelVersion,
rooted: rooted,
rawDescription: rawDescription,
theme: theme,
unknown: unknown,
);

@Deprecated('Assign values directly to the instance.')
SentryOperatingSystem copyWith({
String? name,
Expand Down
9 changes: 0 additions & 9 deletions packages/dart/lib/src/protocol/sentry_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,4 @@ class SentryResponse {
statusCode: statusCode ?? this.statusCode,
data: data ?? this.data,
);

@Deprecated('Will be removed in a future version.')
SentryResponse clone() => SentryResponse(
bodySize: bodySize,
headers: headers,
cookies: cookies,
statusCode: statusCode,
data: data,
);
}
11 changes: 0 additions & 11 deletions packages/dart/lib/src/protocol/sentry_runtime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,6 @@ class SentryRuntime {
};
}

@Deprecated('Will be removed in a future version.')
SentryRuntime clone() => SentryRuntime(
key: key,
name: name,
version: version,
compiler: compiler,
rawDescription: rawDescription,
build: build,
unknown: unknown,
);

SentryRuntime copyWith({
String? key,
String? name,
Expand Down
15 changes: 0 additions & 15 deletions packages/dart/lib/src/protocol/sentry_trace_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,6 @@ class SentryTraceContext {
};
}

@Deprecated('Will be removed in a future version.')
SentryTraceContext clone() => SentryTraceContext(
operation: operation,
traceId: traceId,
spanId: spanId,
description: description,
status: status,
parentSpanId: parentSpanId,
sampled: sampled,
origin: origin,
unknown: unknown,
replayId: replayId,
data: data,
);

SentryTraceContext({
SentryId? traceId,
SpanId? spanId,
Expand Down
3 changes: 2 additions & 1 deletion packages/dart/lib/src/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ class Scope {
}

/// Clones the current Scope
@internal
Scope clone() {
final clone = Scope(_options)
..level = level
Expand Down Expand Up @@ -504,7 +505,7 @@ class Scope {
clone._setContextsSync(
entry.key,
entry.key == SentryFeatureFlags.type && value is SentryFeatureFlags
? value.copy()
? value.clone()
: value,
);
}
Expand Down
1 change: 1 addition & 0 deletions packages/dart/lib/src/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ class Sentry {
_hub.configureScope(callback);

/// Clones the current Hub
@internal
static Hub clone() => _hub.clone();

/// Binds a different client to the current hub
Expand Down
24 changes: 0 additions & 24 deletions packages/dart/test/contexts_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,30 +126,6 @@ void main() {
);
});

test('clone context', () {
// ignore: deprecated_member_use_from_same_package
final clone = contexts.clone();

expect(clone.app!.toJson(), contexts.app!.toJson());
expect(clone.browser!.toJson(), contexts.browser!.toJson());
expect(clone.device!.toJson(), contexts.device!.toJson());
expect(
clone.operatingSystem!.toJson(), contexts.operatingSystem!.toJson());
expect(clone.gpu!.toJson(), contexts.gpu!.toJson());
expect(clone.flags!.toJson(), contexts.flags!.toJson());
for (final element in contexts.runtimes) {
expect(
clone.runtimes.where(
(clone) => MapEquality().equals(element.toJson(), clone.toJson()),
),
isNotEmpty,
);
}

expect(clone['theme'], {'value': 'material'});
expect(clone['version'], {'value': 9});
});

test('set runtimes', () {
final contexts = Contexts();
contexts.runtimes = [
Expand Down
Loading
Loading