Pārlūkot izejas kodu

fix(callstats): do not log whole objects on RN

There are whole objects logged and the react-native app would crash when
logging too much stuff.
dev1
paweldomas 8 gadus atpakaļ
vecāks
revīzija
70eee23136
1 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. 7
    2
      modules/statistics/CallStats.js

+ 7
- 2
modules/statistics/CallStats.js Parādīt failu

@@ -288,7 +288,12 @@ export default class CallStats {
288 288
                 // to not log the whole log batch
289 289
                 // FIXME check the current logging level (currently not exposed
290 290
                 // by the logger implementation)
291
-                console && console.debug('reportError', pc, cs, type);
291
+                // NOTE it is not safe to log whole objects on react-native as
292
+                // those contain too many circular references and may crash
293
+                // the app.
294
+                if (!RTCBrowserType.isReactNative()) {
295
+                    console && console.debug('reportError', pc, cs, type);
296
+                }
292 297
             } else {
293 298
                 logger.debug('reportError', pc, cs, type, ...args);
294 299
             }
@@ -506,7 +511,7 @@ export default class CallStats {
506 511
      * @return {boolean} true if the call was successful or false otherwise.
507 512
      */
508 513
     _addNewFabric() {
509
-        logger.info('addNewFabric', this.remoteUserID, this);
514
+        logger.info('addNewFabric', this.remoteUserID);
510 515
         try {
511 516
             const ret
512 517
                 = CallStats.backend.addNewFabric(

Notiek ielāde…
Atcelt
Saglabāt