From b559c561d80a3b8b131b81d82e2bfda3ae387824 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Wed, 23 Feb 2022 12:09:46 +0100 Subject: [PATCH] Fix deadlock on checking pending notification --- VERSION | 2 +- protocol/activity_center_persistence.go | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 803672cd9..b5ac4b949 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.94.6 +0.94.7 diff --git a/protocol/activity_center_persistence.go b/protocol/activity_center_persistence.go index 31b89a9f1..76f3a131d 100644 --- a/protocol/activity_center_persistence.go +++ b/protocol/activity_center_persistence.go @@ -303,7 +303,14 @@ func (db sqlitePersistence) HasPendingNotificationsForChat(chatID string) (bool, return false, err } - return rows.Next(), nil + result := false + + if rows.Next() { + result = true + rows.Close() + } + + return result, nil } func (db sqlitePersistence) GetActivityCenterNotificationsByID(ids []types.HexBytes) ([]*ActivityCenterNotification, error) {