File 0001-ts-log-Avoid-log-spam-for-ResizeObserver-loop-limit-.patch of Package signal-desktop

From a28813331fde621782ba77fdd0d6d666c981786e Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@cryptomilk.org>
Date: Tue, 2 Nov 2021 09:18:18 +0100
Subject: [PATCH] ts:log: Avoid log spam for ResizeObserver loop limit exceeded

This fills up .config/Signal/logs/app.log with:

{"level":50,"time":"2021-11-02T08:12:00.710Z","pid":23028,"hostname":"magrathea","msg":"Top-level unhandled error: null"}

~50MB per hour
---
 ts/logging/set_up_renderer_logging.ts | 2 ++
 1 file changed, 2 insertions(+)

Index: Signal-Desktop-5.23.0/ts/logging/set_up_renderer_logging.ts
===================================================================
--- Signal-Desktop-5.23.0.orig/ts/logging/set_up_renderer_logging.ts
+++ Signal-Desktop-5.23.0/ts/logging/set_up_renderer_logging.ts
@@ -111,11 +111,15 @@ window.SignalContext.log = {
 }
 
 window.onerror = (event, source, line, column, error) => {
+  if (event === "ResizeObserver loop limit exceeded")
+      return
   const errorInfo = Errors.toLogFormat(error);
+if (errorInfo !== "null") {
   log.error(
     `Top-level unhandled error: ${errorInfo}`,
     toLocation(event, source, line, column)
   );
+}  
 };
 
 window.addEventListener('unhandledrejection', rejectionEvent => {
openSUSE Build Service is sponsored by