Skip to content

Commit

Permalink
don't set dbName to null when db close() is called
Browse files Browse the repository at this point in the history
  • Loading branch information
buenaflor committed Sep 7, 2023
1 parent 8613819 commit d14d661
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions sqflite/lib/src/sentry_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database {
static const dbNameKey = 'db.name';
@internal
// ignore: public_member_api_docs
String? dbName;
String dbName;

/// ```dart
/// import 'package:sqflite/sqflite.dart';
Expand Down Expand Up @@ -82,7 +82,6 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database {
try {
await _database.close();

dbName = null;
span?.status = SpanStatus.ok();
} catch (exception) {
span?.throwable = exception;
Expand Down
4 changes: 0 additions & 4 deletions sqflite/test/sentry_database_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ void main() {

await db.close();

expect(db.dbName, null);

final span = fixture.tracer.children.last;
expect(span.context.operation, 'db');
expect(span.context.description, 'Close DB: $inMemoryDatabasePath');
Expand Down Expand Up @@ -163,8 +161,6 @@ void main() {
expect(db.dbName, inMemoryDatabasePath);

await db.close();

expect(db.dbName, null);
});

tearDown(() {
Expand Down

0 comments on commit d14d661

Please sign in to comment.