diff --git a/api/chalicelib/core/notifications.py b/api/chalicelib/core/notifications.py index ce3c4d61a..c3eadcccd 100644 --- a/api/chalicelib/core/notifications.py +++ b/api/chalicelib/core/notifications.py @@ -34,9 +34,7 @@ def get_all_count(tenant_id, user_id): LEFT JOIN (SELECT notification_id FROM public.user_viewed_notifications WHERE user_viewed_notifications.user_id = %(user_id)s) AS user_viewed_notifications USING (notification_id) - WHERE (notifications.user_id IS NULL OR notifications.user_id =%(user_id)s) AND user_viewed_notifications.notification_id IS NULL - ORDER BY created_at DESC - LIMIT 100;""", + WHERE (notifications.user_id IS NULL OR notifications.user_id =%(user_id)s) AND user_viewed_notifications.notification_id IS NULL;""", {"user_id": user_id}) ) row = cur.fetchone() diff --git a/ee/api/chalicelib/core/notifications.py b/ee/api/chalicelib/core/notifications.py index 5ba58f242..0069063c7 100644 --- a/ee/api/chalicelib/core/notifications.py +++ b/ee/api/chalicelib/core/notifications.py @@ -36,9 +36,7 @@ def get_all_count(tenant_id, user_id): FROM public.user_viewed_notifications WHERE user_viewed_notifications.user_id = %(user_id)s) AS user_viewed_notifications USING (notification_id) WHERE (notifications.tenant_id =%(tenant_id)s - OR notifications.user_id =%(user_id)s) AND user_viewed_notifications.notification_id IS NULL - ORDER BY created_at DESC - LIMIT 100;""", + OR notifications.user_id =%(user_id)s) AND user_viewed_notifications.notification_id IS NULL;""", {"tenant_id": tenant_id, "user_id": user_id}) ) rows = helper.list_to_camel_case(cur.fetchall())