From 3a51684e075d85d0aedb5d09f44c8615c0df2566 Mon Sep 17 00:00:00 2001 From: Lilian Date: Mon, 17 Feb 2025 23:16:51 +0100 Subject: [PATCH] [frontend] Adjust logging severity of some errors --- Iceshrimp.Frontend/Components/LazyComponent.cs | 2 +- Iceshrimp.Frontend/Components/VirtualScroller.cs | 2 +- .../Core/Services/NoteStore/NotificationStore.cs | 4 ++-- Iceshrimp.Frontend/Core/Services/NoteStore/TimelineStore.cs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Iceshrimp.Frontend/Components/LazyComponent.cs b/Iceshrimp.Frontend/Components/LazyComponent.cs index e2ebdc68..7c213555 100644 --- a/Iceshrimp.Frontend/Components/LazyComponent.cs +++ b/Iceshrimp.Frontend/Components/LazyComponent.cs @@ -33,7 +33,7 @@ public class LazyComponent : ComponentBase, IAsyncDisposable if (Visible) return Js.Invoke("getHeight", Target); else { - Logger.LogError("Invisible, no height available"); + Logger.LogWarning("Invisible, no height available"); return null; } } diff --git a/Iceshrimp.Frontend/Components/VirtualScroller.cs b/Iceshrimp.Frontend/Components/VirtualScroller.cs index aa125757..9a7d0b55 100644 --- a/Iceshrimp.Frontend/Components/VirtualScroller.cs +++ b/Iceshrimp.Frontend/Components/VirtualScroller.cs @@ -228,7 +228,7 @@ public class VirtualScroller : ComponentBase, IDisposable where T : IIdentifi if (height == 0) { var add = Items.TryAdd(item.Id, item); - if (add is false) Logger.LogError($"Duplicate notification: {item.Id}"); + if (add is false) Logger.LogWarning($"Duplicate notification: {item.Id}"); } ReRender(); diff --git a/Iceshrimp.Frontend/Core/Services/NoteStore/NotificationStore.cs b/Iceshrimp.Frontend/Core/Services/NoteStore/NotificationStore.cs index 078e0f5c..e078d64f 100644 --- a/Iceshrimp.Frontend/Core/Services/NoteStore/NotificationStore.cs +++ b/Iceshrimp.Frontend/Core/Services/NoteStore/NotificationStore.cs @@ -43,7 +43,7 @@ internal class NotificationStore : NoteMessageProvider, IAsyncDisposable private void OnNotification(object? _, NotificationResponse notificationResponse) { var add = Notifications.TryAdd(notificationResponse.Id, notificationResponse); - if (add is false) _logger.LogError($"Duplicate notification: {notificationResponse.Id}"); + if (add is false) _logger.LogWarning($"Duplicate notification: {notificationResponse.Id}"); Notification?.Invoke(this, notificationResponse); } @@ -55,7 +55,7 @@ internal class NotificationStore : NoteMessageProvider, IAsyncDisposable foreach (var notification in res) { var add = Notifications.TryAdd(notification.Id, notification); - if (add is false) _logger.LogError($"Duplicate notification: {notification.Id}"); + if (add is false) _logger.LogWarning($"Duplicate notification: {notification.Id}"); } return res; diff --git a/Iceshrimp.Frontend/Core/Services/NoteStore/TimelineStore.cs b/Iceshrimp.Frontend/Core/Services/NoteStore/TimelineStore.cs index 0814baf1..d960d5c1 100644 --- a/Iceshrimp.Frontend/Core/Services/NoteStore/TimelineStore.cs +++ b/Iceshrimp.Frontend/Core/Services/NoteStore/TimelineStore.cs @@ -78,7 +78,7 @@ internal class TimelineStore : NoteMessageProvider, IAsyncDisposable, IStreaming foreach (var note in res) { var add = Timelines[timeline].Timeline.TryAdd(note.Id, note); - if (add is false) _logger.LogError($"Duplicate note: {note.Id}"); + if (add is false) _logger.LogWarning($"Duplicate note: {note.Id}"); } return res; @@ -168,7 +168,7 @@ internal class TimelineStore : NoteMessageProvider, IAsyncDisposable, IStreaming if (success) { var add = home!.Timeline.TryAdd(response.Id, response); - if (add is false) _logger.LogError($"Duplicate note: {response.Id}"); + if (add is false) _logger.LogWarning($"Duplicate note: {response.Id}"); } ItemPublished?.Invoke(this, response); }