mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-31 01:00:47 +08:00
Fix wrong inbox notification counters
Avoid counting grouped notifications separately and omit notifications for deleted objects.
This commit is contained in:
@@ -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",
|
||||
)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user