Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
163cce7
Merge branch 'main' into feature/unified-api
marandaneto Oct 14, 2020
b91c954
Merge branch 'main' into feature/unified-api
marandaneto Oct 14, 2020
5018978
feat : static SDK main entry withSentry.init(options),... (#108)
rxlabz Oct 14, 2020
d577e35
Feat : add a Hub class (#113)
rxlabz Oct 19, 2020
fabf56f
feat: sentry options (#116)
marandaneto Oct 20, 2020
2b36bec
ref: Hub passes the Scope (#114)
marandaneto Oct 20, 2020
af3ecc0
Refacto : initialize SentryClient with SentryOptions (#118)
rxlabz Oct 20, 2020
19f5592
ref: SentryId generates UUID (#119)
marandaneto Oct 21, 2020
b51b0da
ref: Event now is SentryEvent and added GPU (#121)
marandaneto Oct 22, 2020
3fa0b79
feat: before breadcrumb and scope ref (#122)
marandaneto Oct 22, 2020
2cc1d78
Ref: Hint is passed across Sentry static class, Hub and Client (#124)
marandaneto Oct 22, 2020
11b821b
Ref: Remove stackFrameFilter in favor of beforeSendCallback (#125)
marandaneto Oct 22, 2020
ee737a2
Ref: Sentry init with null and empty DSN and close method (#126)
marandaneto Oct 22, 2020
eab4ccf
Refacto : add a Transport class (#123)
rxlabz Oct 23, 2020
c301ec6
Ref: execute before send callback (#128)
marandaneto Oct 24, 2020
1794f04
feat: addBreadcrumb to the Sentry static API (#133)
marandaneto Oct 26, 2020
e7db5d1
Feat: add lastEventId to the Sentry static API (#134)
marandaneto Oct 26, 2020
dc962ae
Fix: Breadcrumb data should accept serializable types and not only St…
marandaneto Oct 26, 2020
b9cd68b
Fix: NoOp encode for Web (#138)
marandaneto Oct 26, 2020
7b81890
Fix: execute Integrations on Hub creation (#136)
marandaneto Oct 26, 2020
b1761f4
unified api fixes and add web example (#137)
rxlabz Oct 27, 2020
d249c97
Ref/prepare event & scope.applyToEvent (#140)
rxlabz Oct 27, 2020
dc258d9
Ref : rename files accordely to their content (#141)
rxlabz Oct 27, 2020
c6669c3
rename the `throwable` argument to `exception` (#142)
rxlabz Oct 27, 2020
a0bb939
lint : prefer relative imports and show error when a @required argume…
rxlabz Oct 27, 2020
a7ca364
fix: Unified API code review (#144)
marandaneto Oct 28, 2020
56ac62a
Ref : remove dsn from Transport public API (#145)
rxlabz Oct 28, 2020
209f18a
Fix the pubspecs SDK constraints (#146)
rxlabz Oct 28, 2020
108ac6c
fix : throws on invalid dsn (#148)
rxlabz Oct 28, 2020
a81da3e
add comment to change the DSN
marandaneto Oct 28, 2020
c1812b7
update the workflow to run both on vm and on browser (#150)
rxlabz Oct 28, 2020
f597604
Bump sentry sdk to 4.0.0-alpha.1 (#151)
marandaneto Oct 28, 2020
6d9caff
remove TODOs
marandaneto Oct 28, 2020
32debd7
fix the web example pubspec (#153)
rxlabz Oct 28, 2020
c80365f
Ref: remove platform specific clients to use SentryClient (#152)
rxlabz Oct 29, 2020
2ed0f92
fix conflict
marandaneto Oct 29, 2020
c3ab59f
rewrite changelog
marandaneto Oct 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ref: Remove stackFrameFilter in favor of beforeSendCallback (#125)
  • Loading branch information
marandaneto authored Oct 22, 2020
commit 11b821bc0048ea99582fcd2d583f3334e7c4e355
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- Ref: Event now is SentryEvent and added GPU #121
- Feat: before breadcrumb and scope ref. #122
- Ref: Hint is passed across Sentry static class, Hub and Client #124
- Ref: Remove stackFrameFilter in favor of beforeSendCallback #125

# `package:sentry` changelog

Expand Down
3 changes: 0 additions & 3 deletions dart/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'client_stub.dart'
if (dart.library.html) 'browser_client.dart'
if (dart.library.io) 'io_client.dart';
import 'protocol.dart';
import 'stack_trace.dart';
import 'utils.dart';
import 'version.dart';

Expand Down Expand Up @@ -97,7 +96,6 @@ abstract class SentryClient {
/// Reports an [event] to Sentry.io.
Future<SentryId> captureEvent(
SentryEvent event, {
StackFrameFilter stackFrameFilter,
Scope scope,
dynamic hint,
}) async {
Expand Down Expand Up @@ -128,7 +126,6 @@ abstract class SentryClient {

mergeAttributes(
event.toJson(
stackFrameFilter: stackFrameFilter,
origin: origin,
),
into: data,
Expand Down
4 changes: 1 addition & 3 deletions dart/lib/src/noop_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'client.dart';
import 'protocol.dart';
import 'scope.dart';
import 'sentry_options.dart';
import 'stack_trace.dart';

class NoOpSentryClient implements SentryClient {
NoOpSentryClient._();
Expand Down Expand Up @@ -37,15 +36,14 @@ class NoOpSentryClient implements SentryClient {
@override
Future<SentryId> captureEvent(
SentryEvent event, {
StackFrameFilter stackFrameFilter,
Scope scope,
dynamic hint,
}) =>
Future.value(SentryId.empty());

@override
Future<SentryId> captureException(
dynamic throwable, {
throwable, {
dynamic stackTrace,
Scope scope,
dynamic hint,
Expand Down
5 changes: 1 addition & 4 deletions dart/lib/src/protocol/sentry_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ class SentryEvent {
);

/// Serializes this event to JSON.
Map<String, dynamic> toJson(
{StackFrameFilter stackFrameFilter, String origin}) {
Map<String, dynamic> toJson({String origin}) {
final json = <String, dynamic>{};

if (eventId != null) {
Expand Down Expand Up @@ -254,7 +253,6 @@ class SentryEvent {
json['stacktrace'] = <String, dynamic>{
'frames': encodeStackTrace(
exception.stackTrace,
stackFrameFilter: stackFrameFilter,
origin: origin,
),
};
Expand All @@ -265,7 +263,6 @@ class SentryEvent {
json['stacktrace'] = <String, dynamic>{
'frames': encodeStackTrace(
stackTrace,
stackFrameFilter: stackFrameFilter,
origin: origin,
),
};
Expand Down
14 changes: 1 addition & 13 deletions dart/lib/src/stack_trace.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@

import 'package:stack_trace/stack_trace.dart';

/// Used to filter or modify stack frames before sending the stack trace.
///
/// The input stack frames are in the Sentry.io JSON format. The output
/// stack frames must follow the same format.
///
/// Detailed documentation about the stack trace format is on Sentry.io's
/// web-site: https://docs.sentry.io/development/sdk-dev/overview/.
typedef StackFrameFilter = List<Map<String, dynamic>> Function(
List<Map<String, dynamic>>);

/// Sentry.io JSON encoding of a stack frame for the asynchronous suspension,
/// which is the gap between asynchronous calls.
const Map<String, dynamic> asynchronousGapFrameJson = <String, dynamic>{
Expand All @@ -25,7 +15,6 @@ const Map<String, dynamic> asynchronousGapFrameJson = <String, dynamic>{
/// [stackTrace] must be [String] or [StackTrace].
List<Map<String, dynamic>> encodeStackTrace(
dynamic stackTrace, {
StackFrameFilter stackFrameFilter,
String origin,
}) {
assert(stackTrace is String || stackTrace is StackTrace);
Expand All @@ -47,8 +36,7 @@ List<Map<String, dynamic>> encodeStackTrace(
}
}

final jsonFrames = frames.reversed.toList();
return stackFrameFilter != null ? stackFrameFilter(jsonFrames) : jsonFrames;
return frames.reversed.toList();
}

Map<String, dynamic> encodeStackTraceFrame(Frame frame, {String origin}) {
Expand Down
1 change: 0 additions & 1 deletion dart/test/event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ void main() {
'stacktrace': {
'frames': encodeStackTrace(
error.stackTrace,
stackFrameFilter: null,
origin: null,
)
}
Expand Down
3 changes: 0 additions & 3 deletions dart/test/hub_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ void main() {
client.captureEvent(
fakeEvent,
scope: captureAnyNamed('scope'),
stackFrameFilter: null,
),
).captured.first,
Scope(options),
Expand Down Expand Up @@ -112,7 +111,6 @@ void main() {
client.captureEvent(
fakeEvent,
scope: captureAnyNamed('scope'),
stackFrameFilter: null,
),
).captured.first,
Scope(SentryOptions(dsn: fakeDsn))
Expand Down Expand Up @@ -145,7 +143,6 @@ void main() {
client2.captureEvent(
fakeEvent,
scope: anyNamed('scope'),
stackFrameFilter: null,
),
).called(1);
});
Expand Down
1 change: 0 additions & 1 deletion dart/test/sentry_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void main() {
client.captureEvent(
fakeEvent,
scope: anyNamed('scope'),
stackFrameFilter: null,
),
).called(1);
});
Expand Down
37 changes: 19 additions & 18 deletions dart/test/stack_trace_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,25 @@ void main() {
]);
});

test('allows changing the stack frame list before sending', () {
// ignore: omit_local_variable_types
final StackFrameFilter filter =
(list) => list.where((f) => f['abs_path'] != 'secret.dart').toList();
// TODO: use beforeSend to filter stack frames
// test('allows changing the stack frame list before sending', () {
// // ignore: omit_local_variable_types
// final StackFrameFilter filter =
// (list) => list.where((f) => f['abs_path'] != 'secret.dart').toList();

expect(encodeStackTrace('''
#0 baz (file:///pathto/test.dart:50:3)
#1 bar (file:///pathto/secret.dart:46:9)
''', stackFrameFilter: filter), [
{
'abs_path': 'test.dart',
'function': 'baz',
'lineno': 50,
'colno': 3,
'in_app': true,
'filename': 'test.dart'
},
]);
});
// expect(encodeStackTrace('''
// #0 baz (file:///pathto/test.dart:50:3)
// #1 bar (file:///pathto/secret.dart:46:9)
// ''', stackFrameFilter: filter), [
// {
// 'abs_path': 'test.dart',
// 'function': 'baz',
// 'lineno': 50,
// 'colno': 3,
// 'in_app': true,
// 'filename': 'test.dart'
// },
// ]);
// });
});
}