diff --git a/backend/pkg/api/data_access/notifications.go b/backend/pkg/api/data_access/notifications.go index c8c063b11..6b7ccfe4c 100644 --- a/backend/pkg/api/data_access/notifications.go +++ b/backend/pkg/api/data_access/notifications.go @@ -735,8 +735,9 @@ func (d *DataAccessService) GetMachineNotifications(ctx context.Context, userId } // Sorting and limiting if cursor is present + // Rows can be uniquely identified by (ts, machine_id, event_type) defaultColumns := []t.SortColumn{ - {Column: enums.NotificationsMachinesColumns.Timestamp.ToExpr(), Desc: true, Offset: currentCursor.Epoch}, + {Column: enums.NotificationsMachinesColumns.Timestamp.ToExpr(), Desc: true, Offset: currentCursor.Ts}, {Column: enums.NotificationsMachinesColumns.MachineId.ToExpr(), Desc: false, Offset: currentCursor.MachineId}, {Column: enums.NotificationsMachinesColumns.EventType.ToExpr(), Desc: false, Offset: currentCursor.EventType}, } @@ -855,9 +856,9 @@ func (d *DataAccessService) GetClientNotifications(ctx context.Context, userId u } // Sorting and limiting if cursor is present - // Rows can be uniquely identified by (epoch, client) + // Rows can be uniquely identified by (ts, client) defaultColumns := []t.SortColumn{ - {Column: enums.NotificationsClientsColumns.Timestamp.ToExpr(), Desc: true, Offset: currentCursor.Epoch}, + {Column: enums.NotificationsClientsColumns.Timestamp.ToExpr(), Desc: true, Offset: currentCursor.Ts}, {Column: enums.NotificationsClientsColumns.ClientName.ToExpr(), Desc: false, Offset: currentCursor.Client}, } order, directions := applySortAndPagination(defaultColumns, t.SortColumn{Column: colSort.Column.ToExpr(), Desc: colSort.Desc}, currentCursor.GenericCursor) @@ -952,9 +953,9 @@ func (d *DataAccessService) GetNetworkNotifications(ctx context.Context, userId Limit(uint(limit + 1)) // Sorting and limiting if cursor is present - // Rows can be uniquely identified by (epoch, network, event_type) + // Rows can be uniquely identified by (ts, network, event_type) defaultColumns := []t.SortColumn{ - {Column: enums.NotificationNetworksColumns.Timestamp.ToExpr(), Desc: true, Offset: currentCursor.Epoch}, + {Column: enums.NotificationNetworksColumns.Timestamp.ToExpr(), Desc: true, Offset: currentCursor.Ts}, {Column: enums.NotificationNetworksColumns.Network.ToExpr(), Desc: false, Offset: currentCursor.Network}, {Column: enums.NotificationNetworksColumns.EventType.ToExpr(), Desc: false, Offset: currentCursor.EventType}, } diff --git a/backend/pkg/api/types/data_access.go b/backend/pkg/api/types/data_access.go index 5a21aa0f9..c4326b1ed 100644 --- a/backend/pkg/api/types/data_access.go +++ b/backend/pkg/api/types/data_access.go @@ -129,14 +129,14 @@ type NotificationMachinesCursor struct { MachineName string EventType string EventThreshold float64 - Epoch uint64 + Ts time.Time } type NotificationClientsCursor struct { GenericCursor Client string - Epoch uint64 + Ts time.Time } type NotificationRocketPoolsCursor struct { @@ -151,7 +151,7 @@ type NotificationNetworksCursor struct { GenericCursor Network uint64 - Epoch uint64 + Ts time.Time EventType string }