Skip to content

Commit

Permalink
Revert "Support allowUrls, denyUrls (#2227)"
Browse files Browse the repository at this point in the history
This reverts commit 7b2e0ad.
  • Loading branch information
buenaflor authored Sep 3, 2024
1 parent 7b2e0ad commit c0b9044
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 418 deletions.
14 changes: 0 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@

### Features

- Support allowUrls and denyUrls for Flutter Web ([#2227](https://github.com/getsentry/sentry-dart/pull/2227))

```dart
await SentryFlutter.init(
(options) {
...
options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"];
options.denyUrls = ["^.*ends-with-this\$", "denied-url"];
},
appRunner: () => runApp(MyApp()),
);
```

- Session replay Alpha for Android and iOS ([#2208](https://github.com/getsentry/sentry-dart/pull/2208)).

To try out replay, you can set following options (access is limited to early access orgs on Sentry. If you're interested, [sign up for the waitlist](https://sentry.io/lp/mobile-replay-beta/)):
Expand Down Expand Up @@ -44,7 +31,6 @@

- Add `SentryFlutter.nativeCrash()` using MethodChannels for Android and iOS ([#2239](https://github.com/getsentry/sentry-dart/pull/2239))
- This can be used to test if native crash reporting works

- Add `ignoreRoutes` parameter to `SentryNavigatorObserver`. ([#2218](https://github.com/getsentry/sentry-dart/pull/2218))
- This will ignore the Routes and prevent the Route from being pushed to the Sentry server.
- Ignored routes will also create no TTID and TTFD spans.
Expand Down
12 changes: 9 additions & 3 deletions dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import 'transport/rate_limiter.dart';
import 'transport/spotlight_http_transport.dart';
import 'transport/task_queue.dart';
import 'utils/isolate_utils.dart';
import 'utils/regex_utils.dart';
import 'utils/stacktrace_utils.dart';
import 'version.dart';

Expand Down Expand Up @@ -197,7 +196,7 @@ class SentryClient {
}

var message = event.message!.formatted;
return isMatchingRegexPattern(message, _options.ignoreErrors);
return _isMatchingRegexPattern(message, _options.ignoreErrors);
}

SentryEvent _prepareEvent(SentryEvent event, {dynamic stackTrace}) {
Expand Down Expand Up @@ -416,7 +415,7 @@ class SentryClient {
}

var name = transaction.tracer.name;
return isMatchingRegexPattern(name, _options.ignoreTransactions);
return _isMatchingRegexPattern(name, _options.ignoreTransactions);
}

/// Reports the [envelope] to Sentry.io.
Expand Down Expand Up @@ -594,4 +593,11 @@ class SentryClient {
SentryId.empty(),
);
}

bool _isMatchingRegexPattern(String value, List<String> regexPattern,
{bool caseSensitive = false}) {
final combinedRegexPattern = regexPattern.join('|');
final regExp = RegExp(combinedRegexPattern, caseSensitive: caseSensitive);
return regExp.hasMatch(value);
}
}
2 changes: 0 additions & 2 deletions dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,10 @@ class SentryOptions {

/// The ignoreErrors tells the SDK which errors should be not sent to the sentry server.
/// If an null or an empty list is used, the SDK will send all transactions.
/// To use regex add the `^` and the `$` to the string.
List<String> ignoreErrors = [];

/// The ignoreTransactions tells the SDK which transactions should be not sent to the sentry server.
/// If null or an empty list is used, the SDK will send all transactions.
/// To use regex add the `^` and the `$` to the string.
List<String> ignoreTransactions = [];

final List<String> _inAppExcludes = [];
Expand Down
9 changes: 0 additions & 9 deletions dart/lib/src/utils/regex_utils.dart

This file was deleted.

24 changes: 0 additions & 24 deletions dart/test/utils/regex_utils_test.dart

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions flutter/lib/src/sentry_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'event_processor/android_platform_exception_event_processor.dart';
import 'event_processor/flutter_enricher_event_processor.dart';
import 'event_processor/flutter_exception_event_processor.dart';
import 'event_processor/platform_exception_event_processor.dart';
import 'event_processor/url_filter/url_filter_event_processor.dart';
import 'event_processor/widget_event_processor.dart';
import 'file_system_transport.dart';
import 'flutter_exception_type_identifier.dart';
Expand Down Expand Up @@ -132,7 +131,6 @@ mixin SentryFlutter {

options.addEventProcessor(FlutterEnricherEventProcessor(options));
options.addEventProcessor(WidgetEventProcessor());
options.addEventProcessor(UrlFilterEventProcessor(options));

if (options.platformChecker.platform.isAndroid) {
options.addEventProcessor(
Expand Down
15 changes: 0 additions & 15 deletions flutter/lib/src/sentry_flutter_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,6 @@ class SentryFlutterOptions extends SentryOptions {
/// See https://api.flutter.dev/flutter/foundation/FlutterErrorDetails/silent.html
bool reportSilentFlutterErrors = false;

/// (Web only) Events only occurring on these Urls will be handled and sent to sentry.
/// If an empty list is used, the SDK will send all errors.
/// `allowUrls` uses regex for the matching.
///
/// If used on a platform other than Web, this setting will be ignored.
List<String> allowUrls = [];

/// (Web only) Events occurring on these Urls will be ignored and are not sent to sentry.
/// If an empty list is used, the SDK will send all errors.
/// `denyUrls` uses regex for the matching.
/// In combination with `allowUrls` you can block subdomains of the domains listed in `allowUrls`.
///
/// If used on a platform other than Web, this setting will be ignored.
List<String> denyUrls = [];

/// Enables Out of Memory Tracking for iOS and macCatalyst.
/// See the following link for more information and possible restrictions:
/// https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/
Expand Down

This file was deleted.

Loading

0 comments on commit c0b9044

Please sign in to comment.