diff --git a/metrics/metrics-android.yml b/metrics/metrics-android.yml index a8dffd5ee1..ef02099ab7 100644 --- a/metrics/metrics-android.yml +++ b/metrics/metrics-android.yml @@ -13,4 +13,4 @@ startupTimeTest: binarySizeTest: diffMin: 900 KiB - diffMax: 1350 KiB + diffMax: 1450 KiB diff --git a/packages/dart/lib/src/hub.dart b/packages/dart/lib/src/hub.dart index c2194534fe..157fe6b798 100644 --- a/packages/dart/lib/src/hub.dart +++ b/packages/dart/lib/src/hub.dart @@ -432,6 +432,7 @@ class Hub { } /// Clones the Hub + @internal Hub clone() { if (!_isEnabled) { _options.log(SentryLevel.warning, 'Disabled Hub cloned.'); diff --git a/packages/dart/lib/src/hub_adapter.dart b/packages/dart/lib/src/hub_adapter.dart index 8ff239d229..b67fa5e9de 100644 --- a/packages/dart/lib/src/hub_adapter.dart +++ b/packages/dart/lib/src/hub_adapter.dart @@ -84,6 +84,7 @@ class HubAdapter implements Hub { withScope: withScope, ); + @internal @override Hub clone() => Sentry.clone(); diff --git a/packages/dart/lib/src/noop_hub.dart b/packages/dart/lib/src/noop_hub.dart index 544736a2aa..de75a40052 100644 --- a/packages/dart/lib/src/noop_hub.dart +++ b/packages/dart/lib/src/noop_hub.dart @@ -62,6 +62,7 @@ class NoOpHub implements Hub { }) async => SentryId.empty(); + @internal @override Hub clone() => this; diff --git a/packages/dart/lib/src/protocol/contexts.dart b/packages/dart/lib/src/protocol/contexts.dart index f8530441e1..74d7ebeb4c 100644 --- a/packages/dart/lib/src/protocol/contexts.dart +++ b/packages/dart/lib/src/protocol/contexts.dart @@ -322,27 +322,6 @@ class Contexts extends MapView { 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({ diff --git a/packages/dart/lib/src/protocol/sentry_app.dart b/packages/dart/lib/src/protocol/sentry_app.dart index 8ce387baf1..aeea8efa80 100644 --- a/packages/dart/lib/src/protocol/sentry_app.dart +++ b/packages/dart/lib/src/protocol/sentry_app.dart @@ -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, diff --git a/packages/dart/lib/src/protocol/sentry_browser.dart b/packages/dart/lib/src/protocol/sentry_browser.dart index 9ba214dac9..f9d6bd14ed 100644 --- a/packages/dart/lib/src/protocol/sentry_browser.dart +++ b/packages/dart/lib/src/protocol/sentry_browser.dart @@ -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, diff --git a/packages/dart/lib/src/protocol/sentry_culture.dart b/packages/dart/lib/src/protocol/sentry_culture.dart index bab61d5864..0b9a949aa5 100644 --- a/packages/dart/lib/src/protocol/sentry_culture.dart +++ b/packages/dart/lib/src/protocol/sentry_culture.dart @@ -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, diff --git a/packages/dart/lib/src/protocol/sentry_device.dart b/packages/dart/lib/src/protocol/sentry_device.dart index 4d319d8e16..e7b7024221 100644 --- a/packages/dart/lib/src/protocol/sentry_device.dart +++ b/packages/dart/lib/src/protocol/sentry_device.dart @@ -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, diff --git a/packages/dart/lib/src/protocol/sentry_feature_flag.dart b/packages/dart/lib/src/protocol/sentry_feature_flag.dart index b9d13cbf8f..34b773c6bf 100644 --- a/packages/dart/lib/src/protocol/sentry_feature_flag.dart +++ b/packages/dart/lib/src/protocol/sentry_feature_flag.dart @@ -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, @@ -55,7 +54,4 @@ class SentryFeatureFlag { unknown: unknown ?? this.unknown, ); } - - @Deprecated('Will be removed in a future version.') - SentryFeatureFlag clone() => copyWith(); } diff --git a/packages/dart/lib/src/protocol/sentry_feature_flags.dart b/packages/dart/lib/src/protocol/sentry_feature_flags.dart index 34900f2696..9e6f2841da 100644 --- a/packages/dart/lib/src/protocol/sentry_feature_flags.dart +++ b/packages/dart/lib/src/protocol/sentry_feature_flags.dart @@ -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.from(unknown), ); } @@ -57,7 +56,4 @@ class SentryFeatureFlags { unknown: unknown ?? this.unknown, ); } - - @Deprecated('Will be removed in a future version.') - SentryFeatureFlags clone() => copyWith(); } diff --git a/packages/dart/lib/src/protocol/sentry_feedback.dart b/packages/dart/lib/src/protocol/sentry_feedback.dart index a7af41407f..8e5a74d3a3 100644 --- a/packages/dart/lib/src/protocol/sentry_feedback.dart +++ b/packages/dart/lib/src/protocol/sentry_feedback.dart @@ -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(); } diff --git a/packages/dart/lib/src/protocol/sentry_gpu.dart b/packages/dart/lib/src/protocol/sentry_gpu.dart index 6ef704978a..39bf899b91 100644 --- a/packages/dart/lib/src/protocol/sentry_gpu.dart +++ b/packages/dart/lib/src/protocol/sentry_gpu.dart @@ -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 toJson() { return { diff --git a/packages/dart/lib/src/protocol/sentry_operating_system.dart b/packages/dart/lib/src/protocol/sentry_operating_system.dart index 3c524eab72..0e7e77a06d 100644 --- a/packages/dart/lib/src/protocol/sentry_operating_system.dart +++ b/packages/dart/lib/src/protocol/sentry_operating_system.dart @@ -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, diff --git a/packages/dart/lib/src/protocol/sentry_response.dart b/packages/dart/lib/src/protocol/sentry_response.dart index 4d14c0696e..451a11e1ee 100644 --- a/packages/dart/lib/src/protocol/sentry_response.dart +++ b/packages/dart/lib/src/protocol/sentry_response.dart @@ -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, - ); } diff --git a/packages/dart/lib/src/protocol/sentry_runtime.dart b/packages/dart/lib/src/protocol/sentry_runtime.dart index 295a526457..8399c1f3b5 100644 --- a/packages/dart/lib/src/protocol/sentry_runtime.dart +++ b/packages/dart/lib/src/protocol/sentry_runtime.dart @@ -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, diff --git a/packages/dart/lib/src/protocol/sentry_trace_context.dart b/packages/dart/lib/src/protocol/sentry_trace_context.dart index 96f806ba39..6f897c6b37 100644 --- a/packages/dart/lib/src/protocol/sentry_trace_context.dart +++ b/packages/dart/lib/src/protocol/sentry_trace_context.dart @@ -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, diff --git a/packages/dart/lib/src/scope.dart b/packages/dart/lib/src/scope.dart index a224900f55..286541b9f5 100644 --- a/packages/dart/lib/src/scope.dart +++ b/packages/dart/lib/src/scope.dart @@ -466,6 +466,7 @@ class Scope { } /// Clones the current Scope + @internal Scope clone() { final clone = Scope(_options) ..level = level @@ -504,7 +505,7 @@ class Scope { clone._setContextsSync( entry.key, entry.key == SentryFeatureFlags.type && value is SentryFeatureFlags - ? value.copy() + ? value.clone() : value, ); } diff --git a/packages/dart/lib/src/sentry.dart b/packages/dart/lib/src/sentry.dart index 9bb0095dc7..408f70f432 100644 --- a/packages/dart/lib/src/sentry.dart +++ b/packages/dart/lib/src/sentry.dart @@ -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 diff --git a/packages/dart/test/contexts_test.dart b/packages/dart/test/contexts_test.dart index 060207adf5..4cec711b59 100644 --- a/packages/dart/test/contexts_test.dart +++ b/packages/dart/test/contexts_test.dart @@ -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 = [ diff --git a/packages/flutter/test/integrations/thread_info_integration_test.dart b/packages/flutter/test/integrations/thread_info_integration_test.dart index 8ff1482746..231a88fda5 100644 --- a/packages/flutter/test/integrations/thread_info_integration_test.dart +++ b/packages/flutter/test/integrations/thread_info_integration_test.dart @@ -425,7 +425,7 @@ void main() { ); await fixture.options.lifecycleRegistry.dispatchCallback( - OnProcessSpan(span), + OnProcessSpan(span, Hint()), ); expect( @@ -454,7 +454,7 @@ void main() { ); await fixture.options.lifecycleRegistry.dispatchCallback( - OnProcessSpan(span), + OnProcessSpan(span, Hint()), ); expect( @@ -481,7 +481,7 @@ void main() { ); await fixture.options.lifecycleRegistry.dispatchCallback( - OnProcessSpan(span), + OnProcessSpan(span, Hint()), ); expect( @@ -506,7 +506,7 @@ void main() { ); await fixture.options.lifecycleRegistry.dispatchCallback( - OnProcessSpan(span), + OnProcessSpan(span, Hint()), ); // sync == false is not synchronous, so blocked_main_thread is not set. @@ -532,7 +532,7 @@ void main() { span.setAttribute('sync', SentryAttribute.bool(true)); await fixture.options.lifecycleRegistry.dispatchCallback( - OnProcessSpan(span), + OnProcessSpan(span, Hint()), ); expect(