Skip to content

feat: enable strict concurrency checking#28

Merged
powerje merged 16 commits intover/3.0.0from
feat/strict-concurrency
Mar 23, 2026
Merged

feat: enable strict concurrency checking#28
powerje merged 16 commits intover/3.0.0from
feat/strict-concurrency

Conversation

@VenkataKrishnaGarapati
Copy link
Copy Markdown

Enables -strict-concurrency=complete in CI with zero concurrency warnings.

Changes (6 files, minimal):

  • HTTP.ResponseStatus — added Sendable (enum with Int raw value, trivially Sendable)
  • KumoLogger — added Sendable to protocol
  • HTTPError — added @unchecked Sendable (contains Any types that can't be made Sendable without breaking API)
  • CacheSerializationError / CacheDeserializationError — added @unchecked Sendable
  • StorageAccessError — added @unchecked Sendable
  • InMemory — added @unchecked Sendable (already thread-safe via GCD queue)
  • swift.yml — restored -strict-concurrency=complete flag

Why @unchecked Sendable:

Several error types use Any in their associated values. Changing Any to any Sendable cascades through the entire codebase (every callsite passes [String: Any] dictionaries). Using @unchecked Sendable is the pragmatic approach — these error types are created and thrown, not shared across concurrency domains.

Result:

swift build -Xswiftc -strict-concurrency=complete passes with zero concurrency warnings.

VenkataKrishnaGarapati and others added 15 commits March 20, 2026 16:14
- Add Sendable to HTTP.ResponseStatus (enum with Int raw value)
- Add Sendable to KumoLogger protocol
- Add @unchecked Sendable to HTTPError (contains Any types)
- Add @unchecked Sendable to CacheSerializationError/CacheDeserializationError
- Add @unchecked Sendable to StorageAccessError
- Add @unchecked Sendable to InMemory (GCD queue-based thread safety)
- Restore -strict-concurrency=complete in CI workflow

Build passes with zero concurrency warnings.
- Add @unchecked Sendable to StorageAccessError (contains Any)
- Fix InMemory GCD closures: use nonisolated(unsafe) for weak self
  and type-erase generic D to Any before closure to avoid D.Type
  metatype capture warning
- Result: zero concurrency warnings with -strict-concurrency=complete
…remaining

- Fix weak var -> weak let in InMemory GCD closures (3 warnings)
- Add doc comment to UncheckedSendableBox explaining why it exists
- All 9 @unchecked Sendable usages audited and verified as required
- Zero concurrency warnings with -strict-concurrency=complete
@powerje powerje force-pushed the feat/strict-concurrency branch from 5a7c315 to 3c44489 Compare March 23, 2026 02:14
@powerje powerje merged commit 937f5a6 into ver/3.0.0 Mar 23, 2026
4 checks passed
@powerje powerje deleted the feat/strict-concurrency branch March 23, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants