From 196561fed2cc1df198022b8e218e7f8c9b5a68d1 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 18 Jul 2024 21:49:31 -0600 Subject: [PATCH] init UI increase logs buffer and don't throw on websocket unsubscribe (#2669) * init UI increase logs buffer and don't throw on websocket unsubscribe * fix: remove smooth scroll for logs --------- Co-authored-by: waterplea --- web/projects/ui/src/app/pages/init/init.service.ts | 4 ++-- web/projects/ui/src/app/pages/init/logs/logs.component.ts | 6 +++--- web/projects/ui/src/app/pages/init/logs/logs.service.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/projects/ui/src/app/pages/init/init.service.ts b/web/projects/ui/src/app/pages/init/init.service.ts index 245e1ae24..96bf656d3 100644 --- a/web/projects/ui/src/app/pages/init/init.service.ts +++ b/web/projects/ui/src/app/pages/init/init.service.ts @@ -58,8 +58,8 @@ export class InitService extends Observable { } }), catchError(e => { - // @TODO this toast is presenting when we navigate away from init page. It seems other websockets exhibit the same behavior, but we never noticed because the error were not being caught and presented in this manner - this.errorService.handleError(e) + // @TODO Alex this toast is presenting when we navigate away from init page. It seems other websockets exhibit the same behavior, but we never noticed because the error were not being caught and presented in this manner. It seems odd that unsubscribing from a websocket subject would be treated as an error. + // this.errorService.handleError(e) return EMPTY }), diff --git a/web/projects/ui/src/app/pages/init/logs/logs.component.ts b/web/projects/ui/src/app/pages/init/logs/logs.component.ts index edce1f282..de05d33bd 100644 --- a/web/projects/ui/src/app/pages/init/logs/logs.component.ts +++ b/web/projects/ui/src/app/pages/init/logs/logs.component.ts @@ -24,10 +24,10 @@ export class LogsComponent { scroll = true scrollTo(bottom: HTMLElement) { - if (this.scroll) bottom.scrollIntoView({ behavior: 'smooth' }) + if (this.scroll) bottom.scrollIntoView() } - onBottom([{ isIntersecting }]: readonly IntersectionObserverEntry[]) { - this.scroll = isIntersecting + onBottom(entries: readonly IntersectionObserverEntry[]) { + this.scroll = entries[entries.length - 1].isIntersecting } } diff --git a/web/projects/ui/src/app/pages/init/logs/logs.service.ts b/web/projects/ui/src/app/pages/init/logs/logs.service.ts index 5fe550d45..2553e9872 100644 --- a/web/projects/ui/src/app/pages/init/logs/logs.service.ts +++ b/web/projects/ui/src/app/pages/init/logs/logs.service.ts @@ -39,7 +39,7 @@ export class LogsService extends Observable { this.api.initFollowLogs({ boot: 0 }), ).pipe( switchMap(({ guid }) => this.api.openWebsocket$(guid, {})), - bufferTime(250), + bufferTime(500), filter(logs => !!logs.length), map(convertAnsi), scan((logs: readonly string[], log) => [...logs, log], []),