@@ -19,6 +19,7 @@ import 'sentry_envelope.dart';
19
19
import 'client_reports/client_report_recorder.dart' ;
20
20
import 'client_reports/discard_reason.dart' ;
21
21
import 'transport/data_category.dart' ;
22
+ import 'sentry_client_attachment_processor.dart' ;
22
23
23
24
/// Default value for [User.ipAddress] . It gets set when an event does not have
24
25
/// a user and IP address. Only applies if [SentryOptions.sendDefaultPii] is set
@@ -37,6 +38,9 @@ class SentryClient {
37
38
38
39
SentryStackTraceFactory get _stackTraceFactory => _options.stackTraceFactory;
39
40
41
+ SentryClientAttachmentProcessor get _clientAttachmentProcessor =>
42
+ _options.clientAttachmentProcessor;
43
+
40
44
/// Instantiates a client using [SentryOptions]
41
45
factory SentryClient (SentryOptions options) {
42
46
if (options.sendClientReports) {
@@ -130,12 +134,15 @@ class SentryClient {
130
134
preparedEvent = _eventWithRemovedBreadcrumbsIfHandled (preparedEvent);
131
135
}
132
136
137
+ final attachments = await _clientAttachmentProcessor.processAttachments (
138
+ scope? .attachments ?? [], preparedEvent);
139
+
133
140
final envelope = SentryEnvelope .fromEvent (
134
141
preparedEvent,
135
142
_options.sdk,
136
143
dsn: _options.dsn,
137
144
traceContext: scope? .span? .traceContext (),
138
- attachments: scope ? . attachments,
145
+ attachments: attachments.isNotEmpty ? attachments : null ,
139
146
);
140
147
141
148
final id = await captureEnvelope (envelope);
0 commit comments