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 {
131131 ///
132132 /// Note: This MUST be called every frame, otherwise we *will* miss state updates on requests as DataReady is only available for a single frame
133133 pub fn update ( & mut self ) -> Result < ( ) > {
134+ let initial_reports_size = self . reports . len ( ) ;
135+
134136 self . reports . retain_mut ( |r| {
135137 // Get the request in the report. If one does not exist, create a request
136138 let Some ( request) = r. request else {
@@ -142,7 +144,10 @@ impl SentryPersistentState {
142144 request. state ( ) != NetworkRequestState :: DataReady
143145 } ) ;
144146
145- self . flush ( ) ?;
147+ // Only flush if reports size changed
148+ if self . reports . len ( ) != initial_reports_size {
149+ self . flush ( ) ?;
150+ }
146151
147152 Ok ( ( ) )
148153 }
You can’t perform that action at this time.
0 commit comments