Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2024-05-14 - withTaskGroup Serialization Bug
**Learning:** In Swift structured concurrency, using an `actor` to manage a `withTaskGroup` where tasks invoke synchronous, blocking I/O (like `FileManager` operations) directly on the actor's own methods inadvertently serializes the tasks on the actor's single executor, completely preventing the intended parallelism.
**Action:** For stateless components interacting with thread-safe dependencies like `FileManager.default`, use `struct`s or explicitly `nonisolated` methods to allow tasks to execute genuinely concurrently across the cooperative thread pool.
2 changes: 1 addition & 1 deletion Sources/Cacheout/Scanner/CacheScanner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import Foundation

actor CacheScanner {
struct CacheScanner {
private let fileManager = FileManager.default

func scanAll(_ categories: [CacheCategory]) async -> [ScanResult] {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Cacheout/Scanner/NodeModulesScanner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import Foundation

actor NodeModulesScanner {
struct NodeModulesScanner {
private let fileManager = FileManager.default

/// Common directories where developers keep projects
Expand Down