Skip to content

Commit

Permalink
fun fix & format
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Sep 11, 2023
1 parent f506708 commit 27e1631
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 12 deletions.
3 changes: 1 addition & 2 deletions flutter/lib/src/jvm/jvm_exception.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,8 @@ class JvmException {
}

final thisExceptionFrames = thisException
.where((line) => line.trim().isNotEmpty)
.map((e) => JvmFrame.parse(e))
.where(
(e) => e.originalFrame.isNotEmpty && e.originalFrame.trim() != 'at')
.toList(growable: false);

final suppressedExceptions = supressed
Expand Down
4 changes: 2 additions & 2 deletions flutter/test/jvm/jvm_exception_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void main() {
expect(exception.stackTrace[0].lineNumber, 292);
});

test('parse drops frames with `at ` and empty original frame', () {
test('parse drops empty frames', () {
final exception = JvmException.parse(platformExceptionWithEmptyStackFrames);
expect(exception.stackTrace.length, 13);
expect(exception.stackTrace.last.className,
Expand Down Expand Up @@ -220,5 +220,5 @@ java.lang.RuntimeException: Catch this platform exception!
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit\$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
at
''';
1 change: 1 addition & 0 deletions flutter/test/sentry_navigator_observer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ class _MockHub extends MockHub {
@override
final options = SentryOptions(dsn: fakeDsn);

@override
late final scope = Scope(options);

@override
Expand Down
15 changes: 11 additions & 4 deletions sqflite/lib/src/sentry_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database {
@internal Hub? hub,
}) : _hub = hub ?? HubAdapter(),
dbName = p.basenameWithoutExtension(_database.path),
super(_database,
hub: hub, dbName: p.basenameWithoutExtension(_database.path)) {
super(
_database,
hub: hub,
dbName: p.basenameWithoutExtension(_database.path),
) {
// ignore: invalid_use_of_internal_member
final options = _hub.options;
options.sdk.addIntegration('SentrySqfliteTracing');
Expand Down Expand Up @@ -132,8 +135,12 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database {
setDatabaseAttributeData(span, dbName);

Future<T> newAction(Transaction txn) async {
final executor = SentryDatabaseExecutor(txn,
parentSpan: span, hub: _hub, dbName: dbName);
final executor = SentryDatabaseExecutor(
txn,
parentSpan: span,
hub: _hub,
dbName: dbName,
);
final sentrySqfliteTransaction =
SentrySqfliteTransaction(executor, hub: _hub, dbName: dbName);

Expand Down
3 changes: 2 additions & 1 deletion sqflite/test/mocks/mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ ISentrySpan startTransactionShim(
],
customMocks: [
MockSpec<Hub>(
fallbackGenerators: {#startTransaction: startTransactionShim}),
fallbackGenerators: {#startTransaction: startTransactionShim},
),
],
)
void main() {}
8 changes: 6 additions & 2 deletions sqflite/test/sentry_batch_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ SELECT * FROM Product''';
final span = fixture.tracer.children.last;
expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem);
expect(
span.data[SentryDatabase.dbNameKey], (db as SentryDatabase).dbName);
span.data[SentryDatabase.dbNameKey],
(db as SentryDatabase).dbName,
);

await db.close();
});
Expand All @@ -313,7 +315,9 @@ SELECT * FROM Product''';
final span = fixture.tracer.children.last;
expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem);
expect(
span.data[SentryDatabase.dbNameKey], (db as SentryDatabase).dbName);
span.data[SentryDatabase.dbNameKey],
(db as SentryDatabase).dbName,
);

await db.close();
});
Expand Down
4 changes: 3 additions & 1 deletion sqflite/test/sentry_database_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ void main() {
expect(insertSpan.context.parentSpanId, trSpan.context.spanId);
expect(insertSpan.status, SpanStatus.ok());
expect(
insertSpan.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem);
insertSpan.data[SentryDatabase.dbSystemKey],
SentryDatabase.dbSystem,
);
expect(insertSpan.data[SentryDatabase.dbNameKey], inMemoryDatabasePath);

expect(
Expand Down

0 comments on commit 27e1631

Please sign in to comment.