From 1ce44928d3246efbc6b5fec97508052b6fa024a3 Mon Sep 17 00:00:00 2001 From: peter <1674920+peterbitfly@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:02:59 +0000 Subject: [PATCH 1/2] fix(notifications): track history of gas limit alerts --- backend/pkg/notification/queuing.go | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/backend/pkg/notification/queuing.go b/backend/pkg/notification/queuing.go index 02fde55f3..cb9b04d55 100644 --- a/backend/pkg/notification/queuing.go +++ b/backend/pkg/notification/queuing.go @@ -165,7 +165,21 @@ func ExportNotificationHistory(epoch uint64, notificationsByUserID types.Notific for group, notifications := range notificationsPerGroup { for eventName, notifications := range notifications { // handle all dashboard related notifications - if eventName != types.NetworkLivenessIncreasedEventName && !types.IsUserIndexed(eventName) && !types.IsMachineNotification(eventName) { + if eventName == types.NetworkLivenessIncreasedEventName || eventName == types.NetworkGasAboveThresholdEventName || eventName == types.NetworkGasBelowThresholdEventName { // handle network liveness increased events + for range notifications { + _, err := networktNotificationHistoryInsertStmt.Exec( + userID, + epoch, + utils.Config.Chain.Name, + eventName, + 0, + epochTs, + ) + if err != nil { + log.Error(err, "error inserting into network notifications history", 0) + } + } + } else if eventName != types.NetworkLivenessIncreasedEventName && !types.IsUserIndexed(eventName) && !types.IsMachineNotification(eventName) { details, err := GetNotificationDetails(notifications) if err != nil { log.Error(err, "error getting notification details", 0) @@ -223,20 +237,6 @@ func ExportNotificationHistory(epoch uint64, notificationsByUserID types.Notific log.Error(err, "error inserting into client notifications history", 0) } } - } else if eventName == types.NetworkLivenessIncreasedEventName || eventName == types.NetworkGasAboveThresholdEventName || eventName == types.NetworkGasBelowThresholdEventName { // handle network liveness increased events - for range notifications { - _, err := networktNotificationHistoryInsertStmt.Exec( - userID, - epoch, - utils.Config.Chain.Name, - eventName, - 0, - epochTs, - ) - if err != nil { - log.Error(err, "error inserting into network notifications history", 0) - } - } } } } From 5f63b8c824635b0134c1da5c6cbce8daf63cf958 Mon Sep 17 00:00:00 2001 From: peter <1674920+peterbitfly@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:06:34 +0000 Subject: [PATCH 2/2] fix(notifications): track history of gas limit alerts --- backend/pkg/notification/queuing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/pkg/notification/queuing.go b/backend/pkg/notification/queuing.go index cb9b04d55..09f9687a1 100644 --- a/backend/pkg/notification/queuing.go +++ b/backend/pkg/notification/queuing.go @@ -170,7 +170,7 @@ func ExportNotificationHistory(epoch uint64, notificationsByUserID types.Notific _, err := networktNotificationHistoryInsertStmt.Exec( userID, epoch, - utils.Config.Chain.Name, + utils.Config.Chain.ClConfig.DepositChainID, eventName, 0, epochTs,