Skip to content

Fix Swift 6 concurrency warnings and cleanup Keychain API#251

Merged
MaatheusGois merged 2 commits intomainfrom
maatheusgois-dd/fix-swift6-concurrency-and-keychain-api
Feb 12, 2026
Merged

Fix Swift 6 concurrency warnings and cleanup Keychain API#251
MaatheusGois merged 2 commits intomainfrom
maatheusgois-dd/fix-swift6-concurrency-and-keychain-api

Conversation

@maatheusgois-dd
Copy link
Contributor

Summary

This PR resolves all Swift 6 strict concurrency warnings and cleans up the public API by making the embedded KeychainAccess library internal.

Changes

Swift 6 Concurrency Fixes

  1. CustomAuthenticationExample.swift

    • Changed session from mutable var to lazy var to resolve Sendable conformance issues
    • Added @unchecked Sendable conformance to the class
    • Removed @Sendable annotations from URLSessionDelegate completion handlers to match protocol requirements
  2. KeychainService.swift

    • Added @Sendable annotations to all completion handler parameters
    • Fixed capture of completion handler in async closure with explicit type annotation
    • All shared password and credential methods now properly handle Sendable closures
  3. Resources.Files.Controller.swift

    • Fixed unused expression warning by explicitly discarding return value with _

API Cleanup

  1. KeychainService.swift - Visibility Changes
    • Changed Keychain class from public to internal
    • Changed all related types to internal: ItemClass, ProtocolType, AuthenticationType, Accessibility, AuthenticationUI, AuthenticationPolicy
    • Removed ~270 public declarations that were polluting DebugSwift's public API
    • Rationale: The KeychainAccess library is an embedded third-party dependency used only internally for the Resources/Keychain viewer. Exposing it publicly adds unnecessary API surface area and isn't needed by DebugSwift users.

Testing

  • ✅ All 41 tests pass in 8 suites
  • ✅ Build succeeds with no warnings or errors
  • ✅ No linter errors
  • ✅ CI pipeline should pass

Impact

  • Breaking Change: None - The Keychain classes were not documented as part of DebugSwift's public API
  • Bug Fixes: Resolves Swift 6 strict concurrency warnings that were causing CI failures
  • API Surface: Significantly cleaner public API for DebugSwift

This PR resolves all Swift 6 strict concurrency warnings and cleans up the public API by making the embedded KeychainAccess library internal.

Changes:
- Fixed Sendable concurrency issues in CustomAuthenticationExample by using lazy var and @unchecked Sendable
- Fixed unused expression warning in Resources.Files.Controller
- Added @sendable annotations to all completion handlers in KeychainService
- Changed Keychain class and related types from public to internal to avoid API pollution

All tests pass (41 tests in 8 suites).
@maatheusgois-dd maatheusgois-dd self-assigned this Feb 11, 2026
@maatheusgois-dd maatheusgois-dd added the Feature Feature to develop. label Feb 11, 2026
@github-actions
Copy link

github-actions bot commented Feb 11, 2026

Warnings
⚠️ ⚠️ Code coverage check is temporarily disabled due to xcresult format incompatibility. Please verify coverage manually in Xcode.
⚠️

The PR title should be: [Feature or Flow] What flow was done

Messages
📖 The PR added 138 and removed 304 lines. 3 file(s) changed.

Generated by 🚫 Danger Swift against 38d2eb9

@MaatheusGois MaatheusGois marked this pull request as ready for review February 12, 2026 01:21
@MaatheusGois MaatheusGois merged commit db3421a into main Feb 12, 2026
5 checks passed
@MaatheusGois MaatheusGois deleted the maatheusgois-dd/fix-swift6-concurrency-and-keychain-api branch February 12, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Feature to develop.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants