File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ impl SentryPersistentState {
131
131
///
132
132
/// Note: This MUST be called every frame, otherwise we *will* miss state updates on requests as DataReady is only available for a single frame
133
133
pub fn update ( & mut self ) -> Result < ( ) > {
134
+ let initial_reports_size = self . reports . len ( ) ;
135
+
134
136
self . reports . retain_mut ( |r| {
135
137
// Get the request in the report. If one does not exist, create a request
136
138
let Some ( request) = r. request else {
@@ -142,7 +144,10 @@ impl SentryPersistentState {
142
144
request. state ( ) != NetworkRequestState :: DataReady
143
145
} ) ;
144
146
145
- self . flush ( ) ?;
147
+ // Only flush if reports size changed
148
+ if self . reports . len ( ) != initial_reports_size {
149
+ self . flush ( ) ?;
150
+ }
146
151
147
152
Ok ( ( ) )
148
153
}
You can’t perform that action at this time.
0 commit comments