Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
Fix wrong inbox notification counters
Rūdolfs Ošiņš committed 11 months ago
commit 01d4c0c5b7ca76d6104a67fd21e558ae3f4e74c3
parent 5cb9aaa
1 file changed +2 -2
modified crates/radicle-types/src/outbound/sqlite.rs
@@ -118,9 +118,9 @@ impl InboxStorage for Sqlite {
        notification::ListNotificationsError,
    > {
        let stmt = self.db.prepare(
-
            "SELECT ref, repo, COUNT(*) as count
+
            "SELECT COUNT(DISTINCT substr(ref, 66)) count, ref, repo
                 FROM `repository-notifications`
-
                 WHERE ref LIKE '%cobs%'
+
                 WHERE new NOT NULL AND (ref LIKE '%cobs/xyz.radicle.patch%' OR ref LIKE '%cobs/xyz.radicle.issue%')
                 GROUP BY repo",
        )?;