Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
26 changes: 13 additions & 13 deletions dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -399,19 +399,19 @@ class SentryClient {
}

SentryEvent _eventWithRemovedBreadcrumbsIfHandled(SentryEvent event) {
final mechanisms = (event.exceptions ?? [])
.map((e) => e.mechanism)
.whereType<Mechanism>();
final hasNoMechanism = mechanisms.isEmpty;

final hasOnlyHandledMechanism = mechanisms
.every((e) => (e.handled ?? true));

if (hasNoMechanism || hasOnlyHandledMechanism) {
return event.copyWith(breadcrumbs: []);
} else {
return event;
}
// final mechanisms = (event.exceptions ?? [])
// .map((e) => e.mechanism)
// .whereType<Mechanism>();
// final hasNoMechanism = mechanisms.isEmpty;

// final hasOnlyHandledMechanism = mechanisms
// .every((e) => (e.handled ?? true));

// if (hasNoMechanism || hasOnlyHandledMechanism) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marandaneto Is this final or are you still in implementation process?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just testing and found out that this has to be fixed, hence the comments.

return event.copyWith(breadcrumbs: []);
// } else {
// return event;
// }
}

Future<SentryId?> _attachClientReportsAndSend(SentryEnvelope envelope) {
Expand Down
5 changes: 5 additions & 0 deletions flutter/lib/src/integrations/load_contexts_integration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ class _LoadContextsIntegrationEventProcessor extends EventProcessor {
final breadcrumbsList = infos['breadcrumbs'] as List?;
if (breadcrumbsList != null && breadcrumbsList.isNotEmpty) {
final breadcrumbs = event.breadcrumbs ?? [];
if ((_options.platformChecker.platform.isIOS ||
_options.platformChecker.platform.isMacOS) &&
_options.enableScopeSync) {
breadcrumbs.clear();
}
final newBreadcrumbs =
List<Map<dynamic, dynamic>>.from(breadcrumbsList);

Expand Down