From a3187f15273ec8fdf68d89e25c7fba6aebecf85a Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Thu, 12 Jun 2025 12:18:56 -0700 Subject: [PATCH] Fix uncaught errors from ResizeObserver --- stylesheets/components/NavSidebar.scss | 4 ++++ stylesheets/components/SearchInput.scss | 1 - ts/logging/set_up_renderer_logging.ts | 23 ++++------------------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/stylesheets/components/NavSidebar.scss b/stylesheets/components/NavSidebar.scss index 30a2841d93..379e78d823 100644 --- a/stylesheets/components/NavSidebar.scss +++ b/stylesheets/components/NavSidebar.scss @@ -233,6 +233,10 @@ gap: 12px; } +.NavSidebarSearchHeader .module-SearchInput__container { + flex: 1 0 0; +} + .NavSidebarEmpty { position: absolute; top: 0; diff --git a/stylesheets/components/SearchInput.scss b/stylesheets/components/SearchInput.scss index a2e47eadfe..7a5520c61a 100644 --- a/stylesheets/components/SearchInput.scss +++ b/stylesheets/components/SearchInput.scss @@ -7,7 +7,6 @@ .module-SearchInput { &__container { position: relative; - flex: 1 0 0; margin-inline: 16px; margin-bottom: 8px; } diff --git a/ts/logging/set_up_renderer_logging.ts b/ts/logging/set_up_renderer_logging.ts index a7d744b7ec..3cfe399d2a 100644 --- a/ts/logging/set_up_renderer_logging.ts +++ b/ts/logging/set_up_renderer_logging.ts @@ -114,22 +114,7 @@ window.SignalContext.log = { trace: log.trace, }; -function toLocation( - event: string | Event, - sourceArg?: string, - lineArg?: number, - columnArg?: number -) { - let source = sourceArg; - let line = lineArg; - let column = columnArg; - - if (event instanceof ErrorEvent) { - source ??= event.filename; - line ??= event.lineno; - column ??= event.colno; - } - +function toLocation(source?: string, line?: number, column?: number) { if (source == null) { return '(@ unknown)'; } @@ -142,11 +127,11 @@ function toLocation( return `(@ ${source})`; } -window.onerror = (event, source, line, column, error) => { +window.onerror = (message, source, line, column, error) => { const errorInfo = Errors.toLogFormat(error); log.error( - `Top-level unhandled error: ${errorInfo}`, - toLocation(event, source, line, column) + `Top-level unhandled error: ${message}, ${errorInfo}`, + toLocation(source, line, column) ); };