Skip to content

Synchronous dbQueue.write blocks actor thread in NotificationService #212

@fatihkan

Description

@fatihkan

Bug Description

In NotificationService.swift:34, synchronous dbQueue.write calls block the actor's cooperative thread pool. Under load (many notifications), this can starve other actors and cause UI freezes.

Location

CreedFlow/Sources/CreedFlow/Services/Notifications/NotificationService.swift:34

Severity

Critical — Blocks Swift concurrency thread pool, potential deadlock.

Steps to Fix

  1. Use dbQueue.asyncWrite or wrap in Task.detached with a non-actor-isolated closure
  2. Or move DB writes to a dedicated dispatch queue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcriticalCritical priorityperformancePerformance optimizationswiftSwift/SwiftUI codev1.7.0Target: v1.7.0 release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions