From e24f9f2911b6d892c5960d6feeb90b2e97d5e8fe Mon Sep 17 00:00:00 2001 From: cage Date: Sun, 4 Aug 2024 23:10:18 +0200 Subject: [PATCH] - removed possible infinite loop when getting many notification (the exact number depends from from the server configuration, usually more then 15 notifications would remove the exit condition of the loop). Thanks to the fediverse! :-) --- src/api-client.lisp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/api-client.lisp b/src/api-client.lisp index 95847e8..0b7def3 100644 --- a/src/api-client.lisp +++ b/src/api-client.lisp @@ -857,9 +857,8 @@ the latest 15 mentions)." (labels ((%notifications () (when-let* ((min-id (tooter:id (first notifications-so-far))) (notifications (sort-id< (notifications min-id excluded-types)))) - (loop for notification in notifications do - (when (find notification notifications-so-far :test (make-id=)) + (when (not (find notification notifications-so-far :test (make-id=))) (hooks:run-hook 'hooks:*after-getting-fediverse-notification* notification) (push notification notifications-so-far)))