@@ -19,6 +19,7 @@ import 'sentry_envelope.dart';
1919import 'client_reports/client_report_recorder.dart' ;
2020import 'client_reports/discard_reason.dart' ;
2121import 'transport/data_category.dart' ;
22+ import 'sentry_client_attachment_processor.dart' ;
2223
2324/// Default value for [User.ipAddress] . It gets set when an event does not have
2425/// a user and IP address. Only applies if [SentryOptions.sendDefaultPii] is set
@@ -37,6 +38,9 @@ class SentryClient {
3738
3839 SentryStackTraceFactory get _stackTraceFactory => _options.stackTraceFactory;
3940
41+ SentryClientAttachmentProcessor get _clientAttachmentProcessor =>
42+ _options.clientAttachmentProcessor;
43+
4044 /// Instantiates a client using [SentryOptions]
4145 factory SentryClient (SentryOptions options) {
4246 if (options.sendClientReports) {
@@ -130,12 +134,15 @@ class SentryClient {
130134 preparedEvent = _eventWithRemovedBreadcrumbsIfHandled (preparedEvent);
131135 }
132136
137+ final attachments = await _clientAttachmentProcessor.processAttachments (
138+ scope? .attachments ?? [], preparedEvent);
139+
133140 final envelope = SentryEnvelope .fromEvent (
134141 preparedEvent,
135142 _options.sdk,
136143 dsn: _options.dsn,
137144 traceContext: scope? .span? .traceContext (),
138- attachments: scope ? . attachments,
145+ attachments: attachments.isNotEmpty ? attachments : null ,
139146 );
140147
141148 final id = await captureEnvelope (envelope);
0 commit comments