diff --git a/dart/lib/src/sentry_client.dart b/dart/lib/src/sentry_client.dart index c459053a7e..9efb8484a4 100644 --- a/dart/lib/src/sentry_client.dart +++ b/dart/lib/src/sentry_client.dart @@ -126,7 +126,7 @@ class SentryClient { this is a signal that the app would crash and android would lose the breadcrumbs by the time the app is restarted to read the envelope. */ - //preparedEvent = _eventWithRemovedBreadcrumbsIfHandled(preparedEvent); + preparedEvent = _eventWithRemovedBreadcrumbsIfHandled(preparedEvent); } final envelope = SentryEnvelope.fromEvent( diff --git a/dart/test/mocks/mock_platform.dart b/dart/test/mocks/mock_platform.dart index 3faed41f49..89dc744d10 100644 --- a/dart/test/mocks/mock_platform.dart +++ b/dart/test/mocks/mock_platform.dart @@ -9,9 +9,11 @@ class MockPlatform extends Platform with NoSuchMethodProvider { return MockPlatform(os: 'android'); } + factory MockPlatform.iOS() { + return MockPlatform(os: 'ios'); + } + @override String operatingSystem; - @override - bool get isAndroid => (operatingSystem == 'android'); } diff --git a/dart/test/sentry_client_test.dart b/dart/test/sentry_client_test.dart index 42fe3885f6..feca5980a1 100644 --- a/dart/test/sentry_client_test.dart +++ b/dart/test/sentry_client_test.dart @@ -575,9 +575,6 @@ void main() { final capturedEnvelope = fixture.transport.envelopes.first; final capturedEvent = await eventFromEnvelope(capturedEnvelope); - expect(fixture.options.enableScopeSync, true); - expect(fixture.options.platformChecker.platform.isAndroid, false); - expect(capturedEvent.user!.id, eventUser.id); expect(capturedEvent.level!.name, SentryLevel.warning.name); expect(capturedEvent.transaction, eventTransaction); @@ -1179,7 +1176,8 @@ class Fixture { final recorder = MockClientReportRecorder(); final transport = MockTransport(); - final options = SentryOptions(dsn: fakeDsn); + final options = SentryOptions(dsn: fakeDsn) + ..platformChecker = MockPlatformChecker(platform: MockPlatform.iOS()); late SentryTransactionContext _context; late SentryTracer tracer;