Fix bootstrap meeting unread counts

This commit is contained in:
richjohnrambo
2026-09-05 18:31:13 +08:00
parent baf15848d3
commit 7a1647bf17
7 changed files with 96 additions and 4 deletions
+14
View File
@@ -241,6 +241,7 @@ type testSecurityStore struct {
nextCursor string
unreadTenant types.TenantID
unreadUser types.Uid
unreadEventPrefix string
readTenant types.TenantID
readUser types.Uid
}
@@ -402,6 +403,19 @@ func (s *testSecurityStore) CountUnreadSystemNotifications(tenantID types.Tenant
return count, s.err
}
func (s *testSecurityStore) CountUnreadSystemNotificationsByEventPrefix(tenantID types.TenantID, uid types.Uid, eventPrefix string) (int, error) {
s.unreadTenant = tenantID
s.unreadUser = uid
s.unreadEventPrefix = eventPrefix
count := 0
for _, notification := range s.notifications {
if notification.ReadAt == nil && strings.HasPrefix(notification.EventType, eventPrefix) {
count++
}
}
return count, s.err
}
func (s *testSecurityStore) MarkSystemNotificationRead(tenantID types.TenantID, uid types.Uid, eventID string, readAt time.Time) error {
s.readTenant = tenantID
s.readUser = uid