From da0cbd273c66d7cd51d4726d2f1ac7fb8fc27ab1 Mon Sep 17 00:00:00 2001 From: Jason Buckner Date: Sun, 19 Jul 2026 08:58:51 -0700 Subject: [PATCH] Make InternetArchiveProtocol refine Sendable The concrete InternetArchive is already @unchecked Sendable, but callers only have the protocol type. Refining Sendable lets an actor (or any isolated context) hold an any InternetArchiveProtocol and pass it across isolation boundaries without a data-race diagnostic. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01Cf7er8mrabacGCMtLjd6mQ --- InternetArchiveKit/InternetArchiveProtocols.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/InternetArchiveKit/InternetArchiveProtocols.swift b/InternetArchiveKit/InternetArchiveProtocols.swift index 38d6e71..f8024b5 100644 --- a/InternetArchiveKit/InternetArchiveProtocols.swift +++ b/InternetArchiveKit/InternetArchiveProtocols.swift @@ -8,8 +8,14 @@ import Foundation -/// A protocol to which the main `InternetArchive` class conforms -public protocol InternetArchiveProtocol { +/// A protocol to which the main `InternetArchive` class conforms. +/// +/// Refines `Sendable`: the client is a stateless request builder over a +/// `URLSession`, safe to share across concurrency domains (the concrete +/// `InternetArchive` is `@unchecked Sendable`). This lets callers hold an +/// `any InternetArchiveProtocol` inside an actor or send it across isolation +/// boundaries. +public protocol InternetArchiveProtocol: Sendable { /** Search the Internet Archive