How to use non-Sendable type in async reducer code?

I am working on an app that uses modern TCA (ReducerProtocol and async code). In one of my action handlers in reducer, I have this:

return .run { send in
  let result = await environment.mediaManager.storePhotoOrVideo(
    fromItemProvider: itemProvider,
    mediaSessionId: mediaSessionId,
    configuration: .default
  await send(.mediaManagerStoredPhoto(result))

This is nice and expressive and shows exactly what I want to do. Return type of the environment object function call is Result<URL, MediaManagerError>. I receive itemProvider and process it, receiving the result, and pass it on to another action.

Here is the problem. NSItemProvider is an old type that is not Sendable, and most likely will never be. So I get this warning. Which will be an error further down the road, as Swift keeps strengthening Sendable conformance checking.

Is there a way to use some other API or approach, so that I could keep using non-sendable NSItemProvider here, without any warnings (future errors)?

Since NSItemProvider is part of foundation, does adding @preconcurrency to the Foundation import fix the issue?

@preconcurrency import Foundation

Using @preconcurrency import Foundation doesn’t change anything. The warning remains there.

Just in case, mentioning the versions – I’m using Xcode 14.2 (14C18) which has Swift 5.7.2.

Can you wrap the item provider in an ActorIsolated?