Skip to content

Commit 8d1e9ec

Browse files
committed
rename ctor params
1 parent 08ef583 commit 8d1e9ec

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

supabase/lib/src/sentry_supabase_client.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import 'sentry_supabase_error_client.dart';
2727
/// var supabase = SupabaseClient(
2828
/// 'https://example.com',
2929
/// SentrySupabaseClient(
30-
/// breadcrumbs: false,
31-
/// tracing: false,
32-
/// errors: true,
30+
/// enableBreadcrumbs: false,
31+
/// enableTracing: false,
32+
/// enableErrors: true,
3333
/// ),
3434
/// );
3535
/// ```
@@ -47,34 +47,34 @@ import 'sentry_supabase_error_client.dart';
4747
/// Body data will not be sent by default. You can enable it by setting the
4848
/// `sendDefaultPii` option in the [SentryOptions].
4949
class SentrySupabaseClient extends BaseClient {
50-
final bool _breadcrumbs;
51-
final bool _tracing;
52-
final bool _errors;
50+
final bool _enableBreadcrumbs;
51+
final bool _enableTracing;
52+
final bool _enableErrors;
5353

5454
Client _innerClient;
5555
final Hub _hub;
5656

5757
SentrySupabaseClient({
58-
bool breadcrumbs = true,
59-
bool tracing = true,
60-
bool errors = true,
58+
bool enableBreadcrumbs = true,
59+
bool enableTracing = true,
60+
bool enableErrors = true,
6161
Client? client,
6262
Hub? hub,
63-
}) : _breadcrumbs = breadcrumbs,
64-
_tracing = tracing,
65-
_errors = errors,
63+
}) : _enableBreadcrumbs = enableBreadcrumbs,
64+
_enableTracing = enableTracing,
65+
_enableErrors = enableErrors,
6666
_innerClient = client ?? Client(),
6767
_hub = hub ?? HubAdapter();
6868

6969
@override
7070
Future<StreamedResponse> send(BaseRequest request) async {
71-
if (_breadcrumbs) {
71+
if (_enableBreadcrumbs) {
7272
_innerClient = SentrySupabaseBreadcrumbClient(_innerClient, _hub);
7373
}
74-
if (_tracing) {
74+
if (_enableTracing) {
7575
_innerClient = SentrySupabaseTracingClient(_innerClient, _hub);
7676
}
77-
if (_errors) {
77+
if (_enableErrors) {
7878
_innerClient = SentrySupabaseErrorClient(_innerClient, _hub);
7979
}
8080
return _innerClient.send(request);

supabase/test/sentry_supabase_client_test.dart

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ void main() {
1616
group('Inner Client', () {
1717
test('send called on send', () async {
1818
final sut = fixture.getSut(
19-
breadcrumbs: true,
20-
tracing: true,
21-
errors: true,
19+
enableBreadcrumbs: true,
20+
enableTracing: true,
21+
enableErrors: true,
2222
);
2323

2424
final request = Request('GET', Uri.parse('https://example.com/123'));
@@ -31,9 +31,9 @@ void main() {
3131

3232
test('close called on close', () async {
3333
final sut = fixture.getSut(
34-
breadcrumbs: true,
35-
tracing: true,
36-
errors: true,
34+
enableBreadcrumbs: true,
35+
enableTracing: true,
36+
enableErrors: true,
3737
);
3838

3939
sut.close();
@@ -45,9 +45,9 @@ void main() {
4545
group('Inner Sentry Supabase Clients', () {
4646
test('breadcrumb client', () async {
4747
final sut = fixture.getSut(
48-
breadcrumbs: true,
49-
tracing: false,
50-
errors: false,
48+
enableBreadcrumbs: true,
49+
enableTracing: false,
50+
enableErrors: false,
5151
);
5252

5353
final request = Request('GET', Uri.parse('https://example.com/123'));
@@ -58,9 +58,9 @@ void main() {
5858

5959
test('tracing client', () async {
6060
final sut = fixture.getSut(
61-
breadcrumbs: false,
62-
tracing: true,
63-
errors: false,
61+
enableBreadcrumbs: false,
62+
enableTracing: true,
63+
enableErrors: false,
6464
);
6565

6666
final request = Request('GET', Uri.parse('https://example.com/123'));
@@ -71,9 +71,9 @@ void main() {
7171

7272
test('error client', () async {
7373
final sut = fixture.getSut(
74-
breadcrumbs: false,
75-
tracing: false,
76-
errors: true,
74+
enableBreadcrumbs: false,
75+
enableTracing: false,
76+
enableErrors: true,
7777
);
7878

7979
fixture.mockClient.statusCode = 404;
@@ -86,9 +86,9 @@ void main() {
8686

8787
test('all clients', () async {
8888
final sut = fixture.getSut(
89-
breadcrumbs: true,
90-
tracing: true,
91-
errors: true,
89+
enableBreadcrumbs: true,
90+
enableTracing: true,
91+
enableErrors: true,
9292
);
9393

9494
fixture.mockClient.statusCode = 404;
@@ -113,14 +113,14 @@ class Fixture {
113113
late final mockHub = MockHub(options);
114114

115115
SentrySupabaseClient getSut({
116-
required bool breadcrumbs,
117-
required bool tracing,
118-
required bool errors,
116+
required bool enableBreadcrumbs,
117+
required bool enableTracing,
118+
required bool enableErrors,
119119
}) {
120120
return SentrySupabaseClient(
121-
breadcrumbs: breadcrumbs,
122-
tracing: tracing,
123-
errors: errors,
121+
enableBreadcrumbs: enableBreadcrumbs,
122+
enableTracing: enableTracing,
123+
enableErrors: enableErrors,
124124
client: mockClient,
125125
hub: mockHub,
126126
);

0 commit comments

Comments
 (0)