Skip to content

chore: swift concurrency updates#72

Merged
sozercan merged 3 commits intomainfrom
swift-concurrency
Jan 16, 2026
Merged

chore: swift concurrency updates#72
sozercan merged 3 commits intomainfrom
swift-concurrency

Conversation

@sozercan
Copy link
Owner

@sozercan sozercan commented Jan 15, 2026

Description

AI Prompt (Optional)

🤖 AI Prompt Used
<!-- Paste your prompt here, or write "N/A - Manual implementation" -->

AI Tool:

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🎨 UI/UX improvement
  • ♻️ Refactoring (no functional changes)
  • 🧪 Test update
  • 🔧 Build/CI configuration

Related Issues

Changes Made

Testing

  • Unit tests pass (xcodebuild test -only-testing:KasetTests)
  • Manual testing performed
  • UI tested on macOS 26+

Checklist

  • My code follows the project's style guidelines
  • I have run swiftlint --strict && swiftformat .
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally
  • I have updated documentation if needed
  • I have checked for any performance implications
  • My changes generate no new warnings

Screenshots

Additional Notes

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings January 15, 2026 06:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the codebase to Swift 6 strict concurrency mode by adding nonisolated annotations, enabling new Swift 6.2 features, and improving concurrency-related comments and documentation.

Changes:

  • Enabled Swift 6 concurrency features including SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor and SWIFT_UPCOMING_FEATURE_NONISOLATEDNONSENDINGBYDEFAULT
  • Added nonisolated annotations to test classes, enums, structs, and static members
  • Improved comments explaining Task.detached usage for off-MainActor I/O operations
  • Added comprehensive Swift Concurrency reference documentation

Reviewed changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Kaset.xcodeproj/project.pbxproj Added Swift 6 concurrency build settings
.swiftformat Added nonisolated to modifier order
Tests/KasetUITests/*.swift Marked UI test classes as nonisolated
Tests/KasetUITests/KasetUITestCase.swift Added extensive nonisolated annotations to test helpers
Tests/KasetTests/Helpers/MockURLProtocol.swift Added nonisolated annotations and improved comments
Core/Models/*.swift Added nonisolated to model structs and enums
Core/Utilities/*.swift Added nonisolated to utility enums and updated comments
Core/Services/*.swift Improved Task.detached comments
.github/skills/swift-concurrency/* Added comprehensive Swift Concurrency reference documentation
Comments suppressed due to low confidence (1)

Core/Utilities/DiagnosticsLogger.swift:1

  • Redundant nonisolated on static let constants within a nonisolated enum. Immutable static properties within nonisolated types are inherently nonisolated.
import Foundation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 7 to 10
nonisolated enum TestAccessibilityID {
nonisolated enum Sidebar {
nonisolated static let container = "sidebar"
nonisolated static let searchItem = "sidebar.search"
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant nonisolated annotations on nested types and static properties. With SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor enabled, these enums and their static string constants are inherently nonisolated (immutable value types). The outer nonisolated on the enum is sufficient; inner annotations add noise without providing value.

Copilot uses AI. Check for mistakes.
Comment on lines 33 to 38
nonisolated struct MockFavoriteItem {
let id: String
let pinnedAt: Date
let type: MockFavoriteType

enum MockFavoriteType {
nonisolated enum MockFavoriteType {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant nonisolated on nested enum within a struct. Value types (structs/enums) with immutable properties are inherently nonisolated. Only the struct-level annotation is needed.

Copilot uses AI. Check for mistakes.

/// Creates a mock song favorite.
static func song(videoId: String, title: String, artist: String) -> MockFavoriteItem {
nonisolated static func song(videoId: String, title: String, artist: String) -> MockFavoriteItem {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant nonisolated on static factory methods within an already nonisolated type. Static methods on nonisolated types inherit the isolation.

Copilot uses AI. Check for mistakes.

/// Represents a song/track from YouTube Music.
struct Song: Identifiable, Codable, Hashable, Sendable {
nonisolated struct Song: Identifiable, Codable, Hashable, Sendable {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant nonisolated annotation. Value types conforming to Sendable are implicitly nonisolated. This annotation is unnecessary and adds visual clutter.

Copilot uses AI. Check for mistakes.
Comment on lines 134 to 141
nonisolated static func == (lhs: Song, rhs: Song) -> Bool {
// Compare by video ID for identity equality
lhs.videoId == rhs.videoId
}

func hash(into hasher: inout Hasher) {
nonisolated func hash(into hasher: inout Hasher) {
hasher.combine(self.videoId)
}
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant nonisolated on protocol requirement implementations. Equatable and Hashable protocol requirements are inherently nonisolated, as they must be callable from any context.

Copilot uses AI. Check for mistakes.
Comment on lines 5 to 9
nonisolated enum AccessibilityID {
// MARK: - Sidebar

enum Sidebar {
nonisolated enum Sidebar {
static let container = "sidebar"
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant nonisolated on nested enums. The outer enum annotation is sufficient; nested types inherit nonisolation.

Copilot uses AI. Check for mistakes.
// swiftlint:disable:next force_try
let data = try! JSONSerialization.data(withJSONObject: json)
self.requestHandler = { request in
Self.requestHandler = { request in
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent use of Self vs self. Line 67 uses Self.requestHandler while line 81 uses self.requestHandler for the same pattern. Prefer consistent capitalization.

Copilot uses AI. Check for mistakes.
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
@sozercan sozercan merged commit 686ddf2 into main Jan 16, 2026
6 checks passed
@sozercan sozercan deleted the swift-concurrency branch February 25, 2026 07:31
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