Skip to content

Commit

Permalink
feat(cbl_sentry): upgrade to Sentry 6.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
blaugold committed Feb 3, 2022
1 parent 80f18a9 commit f600208
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
13 changes: 2 additions & 11 deletions packages/cbl_sentry/example/lib/main.dart
Expand Up @@ -12,18 +12,9 @@ Future<void> main() async {
..dsn = File.fromUri(Uri.parse('sentry_dsn.txt')).readAsStringSync()
..tracesSampleRate = 1
..addIntegration(CouchbaseLiteIntegration()),
appRunner: () async {
try {
await runApp();
} finally {
// TODO(blaugold): call Sentry.close when Sentry.init finishes
// This is a workaround for
// https://github.com/getsentry/sentry-dart/issues/730
Future<void>.delayed(const Duration(seconds: 3), Sentry.close);
}
},
appRunner: runApp,
);
// await Sentry.close();
await Sentry.close();
}

late final AsyncDatabase db;
Expand Down
2 changes: 1 addition & 1 deletion packages/cbl_sentry/pubspec.yaml
Expand Up @@ -12,7 +12,7 @@ environment:

dependencies:
cbl: ^1.0.0-beta.14
sentry: ^6.2.2
sentry: ^6.3.0

dev_dependencies:
cbl_dart: ^1.0.0-beta.5
Expand Down
12 changes: 12 additions & 0 deletions packages/cbl_sentry/test/utils/mock_hub.dart
Expand Up @@ -6,6 +6,9 @@ class MockHub implements Hub {
final breadcrumbs = <Breadcrumb>[];
final transactions = <MockSpan>[];

@override
SentryOptions get options => SentryOptions();

@override
void addBreadcrumb(Breadcrumb crumb, {Object? hint}) {
breadcrumbs.add(crumb);
Expand Down Expand Up @@ -81,6 +84,9 @@ class MockHub implements Hub {
String operation, {
String? description,
bool? bindToScope,
bool? waitForChildren,
Duration? autoFinishAfter,
bool? trimEnd,
Map<String, dynamic>? customSamplingContext,
}) =>
startTransactionWithContext(
Expand All @@ -91,13 +97,19 @@ class MockHub implements Hub {
),
customSamplingContext: customSamplingContext,
bindToScope: bindToScope,
waitForChildren: waitForChildren,
autoFinishAfter: autoFinishAfter,
trimEnd: trimEnd,
);

@override
ISentrySpan startTransactionWithContext(
SentryTransactionContext transactionContext, {
Map<String, dynamic>? customSamplingContext,
bool? bindToScope,
bool? waitForChildren,
Duration? autoFinishAfter,
bool? trimEnd,
}) {
final span = MockSpan(
transactionContext.operation,
Expand Down

0 comments on commit f600208

Please sign in to comment.